File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,9 @@ import (
12
12
"strconv"
13
13
"strings"
14
14
15
- "github.com/mcuadros/go-version"
16
15
"github.com/go-git/go-git/v5/plumbing"
17
16
"github.com/go-git/go-git/v5/plumbing/object"
17
+ "github.com/mcuadros/go-version"
18
18
)
19
19
20
20
// GetRefCommitID returns the last commit ID string of given reference (branch or tag).
@@ -94,9 +94,15 @@ func (repo *Repository) getCommit(id SHA1) (*Commit, error) {
94
94
gogitCommit , err := repo .gogitRepo .CommitObject (id )
95
95
if err == plumbing .ErrObjectNotFound {
96
96
tagObject , err = repo .gogitRepo .TagObject (id )
97
+ if err == plumbing .ErrObjectNotFound {
98
+ return nil , ErrNotExist {
99
+ ID : id .String (),
100
+ }
101
+ }
97
102
if err == nil {
98
103
gogitCommit , err = repo .gogitRepo .CommitObject (tagObject .Target )
99
104
}
105
+ // if we get a plumbing.ErrObjectNotFound here then the repository is broken and it should be 500
100
106
}
101
107
if err != nil {
102
108
return nil , err
You can’t perform that action at this time.
0 commit comments