Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NonLogicalDev
Copy link

@NonLogicalDev NonLogicalDev commented May 17, 2019

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 NonLogicalDev force-pushed the fix/fetch-unrelated-remotes branch 2 times, most recently from 8c61d43 to 77f216e Compare May 17, 2019 01:20
…Fixes src-d#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.

Signed-off-by: Oleg Utkin <[email protected]>
@mcuadros
Copy link
Contributor

How behaves git?

@NonLogicalDev
Copy link
Author

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
Copy link
Author

@mcuadros Any update on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NewCommitPreorderIter Fails with object not found When iterating over incomplete history.
2 participants