If an intermediate tree already exists and we know this ahead of time,
we should use it without recreating it with all of its contents resolved
and written recursively. This commit adds support for such cases and
renames TreeBuilder's APIs to generalize away from accepting blob IDs
only.
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>
- 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>
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>
1. Commit now returns the ID of the newly created commit. This will help
us avoid extraneous calls to repo.Reference to get the new state of
the affected ref.
2. Commit also creates the ref if it doesn't already exist. This allows
to skip initializing (to zero) refs we're about to commit to anyway.
Note: this commit does not actually remove those extra
initializations. That is left to a future patch or clean up pass.
Signed-off-by: Aditya Sirish <aditya@saky.in>
* Add functions to track changes introduced by commits or between commits
* Add function to check if a commit knows another using reachability
Signed-off-by: Aditya Sirish <aditya@saky.in>