This repository was archived by the owner on Sep 11, 2020. It is now read-only.
Update local remote references during fetch even if no pack needs to be received #434
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I recently ran into some behavior that was not consistent with the standard git tooling.
It seems that doing a
(*Remote).Fetch()
will not update the local remote refs (i.e.refs/remotes/origin/*
) if we already have all the new commit objects locally. The standard git tooling will continue to update the local remote refs even if it doesn't need to fetch a pack file with new commit objects.You can see an example below where we are in a repository that already has both
7a58be
and2d8e82
.But the current remote references are out of date:
The fetch will not pull down any new commit objects, but will proceed with updating the remote refs in the local repository.
I'm not really sure from an API design side if we want to continue to return the
NoErrAlreadyUpToDate
error, but the current PR changes preserve this in the response.