aboutsummaryrefslogtreecommitdiffstats
path: root/remote.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-01-12 14:48:31 +0100
committerGitHub <noreply@github.com>2017-01-12 14:48:31 +0100
commite69dab7fd7800c0c34c4caf2157f5d9c6638d855 (patch)
tree8b26493aeb1d85cdaddd9a39c4ca259e51b47186 /remote.go
parentf9c7c8c2158140d75d4d5a2fa925fc35ad77be9b (diff)
downloadgo-git-e69dab7fd7800c0c34c4caf2157f5d9c6638d855.tar.gz
remote: fix empty-git-upload-pack error in fetch, when the reference points to a non-commit object (#209)
Diffstat (limited to 'remote.go')
-rw-r--r--remote.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/remote.go b/remote.go
index 1894fdc..c3fa042 100644
--- a/remote.go
+++ b/remote.go
@@ -355,7 +355,8 @@ func getWants(spec []config.RefSpec, localStorer Storer, remoteRefs storer.Refer
}
hash := ref.Hash()
- exists, err := commitExists(localStorer, hash)
+
+ exists, err := objectExists(localStorer, hash)
if err != nil {
return err
}
@@ -378,8 +379,8 @@ func getWants(spec []config.RefSpec, localStorer Storer, remoteRefs storer.Refer
return result, nil
}
-func commitExists(s storer.EncodedObjectStorer, h plumbing.Hash) (bool, error) {
- _, err := s.EncodedObject(plumbing.CommitObject, h)
+func objectExists(s storer.EncodedObjectStorer, h plumbing.Hash) (bool, error) {
+ _, err := s.EncodedObject(plumbing.AnyObject, h)
if err == plumbing.ErrObjectNotFound {
return false, nil
}