This commit introduces gittuf's custom representation of a Git
repository. In addition, it introduces notion of a Hash type to
represent a Git ID. This can be either SHA-1 or SHA-256.
Signed-off-by: Aditya Sirish <aditya@saky.in>
Also updates error chaining in signature verification to preserve error
context, making debugging easier.
Signed-off-by: Aditya Sirish <aditya@saky.in>
- Clarified TODO for GetCommitsBetweenRange, passing the commit id's in
reverse order should change the result of the function.
Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
- Created test with a git tree containing a merge commit
- Added additional edge cases for regular git tree
Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
- Changed handling of merge commits to check if one of the parent commits
matches the current commit. If not we return the sorted diffs between
the current commit and all parent commits.
Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
- Make CreateCommitObject support merge commits, with multiple parent
hashes
- Changed other files to use an array of parent hashes instead of a
single hash
- By changing the parameters for CreateCommitObject, internal/common had
errors that had to be fixed.
Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
- Double initial capacity of reSpecs slice in Fetch for higher efficiency in
append operations
Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
TreeBuilder allows for adding multiple files (with their blob IDs) to a
tree, creating intermediate trees on the fly based on the files' paths.
This is based significantly off "buildTreeHelper" in go-git. It's
possible this will eventually be upstreamed to go-git in plumbing and
used in "buildTreeHelper".
cc @pjbgf
Signed-off-by: Aditya Sirish <aditya@saky.in>
This allows us to perform additional checks in future such as whether an
object is replaced by a replace ref. It also makes it easier to switch
between go-git and another mechanism to invoke Git, such as directly
using the binary.
Signed-off-by: Aditya Sirish <aditya@saky.in>
This removes the sub-go.mod in favor of updating all references to the
third_party/go-git package.
This lets users `go install` from outside of the module.
Signed-off-by: Billy Lynch <billy@chainguard.dev>