Skip to content

Commit eaf0d7d

Browse files
dprotasogmlewis
authored andcommitted
Update git_refs.go (#1240)
1 parent 6de976c commit eaf0d7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

github/git_refs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func (s *GitService) GetRef(ctx context.Context, owner string, repo string, ref
6969
if _, ok := err.(*json.UnmarshalTypeError); ok {
7070
// Multiple refs, means there wasn't an exact match.
7171
return nil, resp, errors.New("multiple matches found for this ref")
72-
} else if resp.StatusCode == 404 {
72+
} else if _, ok := err.(*ErrorResponse); ok && resp.StatusCode == 404 {
7373
// No ref, there was no match for the ref
7474
return nil, resp, errors.New("no match found for this ref")
7575
} else if err != nil {

0 commit comments

Comments
 (0)