go-git
go-git copied to clipboard
Fix an edge case when fetching remotes with unrelated incomplete history. Fixes #1151
In getHaves, allow the getHavesRef to fail with object not found when
iterating over incomplete history, and don't treat it as a fatal error.
It might also worth to revise the object.NewCommitPreorderIter logic,
to perhaps not fail once reachable commits are exhausted.
Fixes #1151
How behaves git?
It does not error out when attempting to fetch on a shallowly cloned repository. Just checked:
git init
git remote add repo1 <url1>
git fetch repo1 --depth 1
git remote add repo2 <url2>
git fetch repo2 --depth 1 // this works in git, but equivalent fails in `go-git`
In the same situation go-git catches an error object not found when enumerating wants
@mcuadros Any update on this?