Skip to content

Commit

Permalink
Try to handle issues with detached head and tag searches
Browse files Browse the repository at this point in the history
  • Loading branch information
leosunmo committed Mar 1, 2023
1 parent 148f4d1 commit 2801bc2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"errors"
"flag"
"fmt"
"log"
Expand Down Expand Up @@ -63,6 +64,9 @@ func main() {
var hash string
tag, count, hash, err = getLatestTagFromRepository(r)
if err != nil {
if errors.Is(err, plumbing.ErrObjectNotFound) {
tag = ""
}
log.Fatalf("Failed to get latest tag from %s, err %s\n", path, err.Error())
}
if count != 0 && !ignoreUncleanTag && !getBranch && !getCommit {
Expand Down

0 comments on commit 2801bc2

Please sign in to comment.