go-git icon indicating copy to clipboard operation
go-git copied to clipboard

Fix an edge case when fetching remotes with unrelated incomplete history. Fixes #1151

Open NonLogicalDev opened this issue 6 years ago • 3 comments

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

NonLogicalDev avatar May 17 '19 01:05 NonLogicalDev

How behaves git?

mcuadros avatar May 27 '19 08:05 mcuadros

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

NonLogicalDev avatar May 30 '19 01:05 NonLogicalDev

@mcuadros Any update on this?

NonLogicalDev avatar Sep 17 '19 22:09 NonLogicalDev