aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2018-04-17 14:31:19 +0200
committerGitHub <noreply@github.com>2018-04-17 14:31:19 +0200
commitb30763cb64afa91c016b23e905af0a378eb1b76d (patch)
treef959b230dd2b5bbd1ae497bcdc7bc5c68e80d7eb /repository_test.go
parent46a247f8c11e580d85ef6378848a15e17b8b5401 (diff)
parent0c7d7c6fc44a88b9ecd8aac9744272a71dd91f02 (diff)
downloadgo-git-b30763cb64afa91c016b23e905af0a378eb1b76d.tar.gz
Merge pull request #706 from antham/resolve-commit-sha1v4.3.1
Resolve full commit sha
Diffstat (limited to 'repository_test.go')
-rw-r--r--repository_test.go16
1 files changed, 13 insertions, 3 deletions
diff --git a/repository_test.go b/repository_test.go
index be7f163..b78fbb7 100644
--- a/repository_test.go
+++ b/repository_test.go
@@ -1494,6 +1494,7 @@ func (s *RepositorySuite) TestResolveRevision(c *C) {
"branch~1": "918c48b83bd081e863dbe1b80f8998f058cd8294",
"v1.0.0~1": "918c48b83bd081e863dbe1b80f8998f058cd8294",
"master~1": "918c48b83bd081e863dbe1b80f8998f058cd8294",
+ "918c48b83bd081e863dbe1b80f8998f058cd8294": "918c48b83bd081e863dbe1b80f8998f058cd8294",
}
for rev, hash := range datas {
@@ -1513,10 +1514,19 @@ func (s *RepositorySuite) TestResolveRevisionWithErrors(c *C) {
err := r.clone(context.Background(), &CloneOptions{URL: url})
c.Assert(err, IsNil)
+ headRef, err := r.Head()
+ c.Assert(err, IsNil)
+
+ ref := plumbing.NewHashReference("refs/heads/918c48b83bd081e863dbe1b80f8998f058cd8294", headRef.Hash())
+ err = r.Storer.SetReference(ref)
+ c.Assert(err, IsNil)
+
datas := map[string]string{
- "efs/heads/master~": "reference not found",
- "HEAD^3": `Revision invalid : "3" found must be 0, 1 or 2 after "^"`,
- "HEAD^{/whatever}": `No commit message match regexp : "whatever"`,
+ "efs/heads/master~": "reference not found",
+ "HEAD^3": `Revision invalid : "3" found must be 0, 1 or 2 after "^"`,
+ "HEAD^{/whatever}": `No commit message match regexp : "whatever"`,
+ "4e1243bd22c66e76c2ba9eddc1f91394e57f9f83": "reference not found",
+ "918c48b83bd081e863dbe1b80f8998f058cd8294": `refname "918c48b83bd081e863dbe1b80f8998f058cd8294" is ambiguous`,
}
for rev, rerr := range datas {