mirror of
https://github.com/fiatjaf/nak.git
synced 2025-12-22 22:48:50 +00:00
git: fix --tags
This commit is contained in:
5
git.go
5
git.go
@@ -532,9 +532,11 @@ aside from those, there is also:
|
|||||||
log("- setting HEAD to branch %s\n", color.CyanString(remoteBranch))
|
log("- setting HEAD to branch %s\n", color.CyanString(remoteBranch))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c.Bool("tags") {
|
||||||
// add all refs/tags
|
// add all refs/tags
|
||||||
output, err := exec.Command("git", "show-ref", "--tags").Output()
|
output, err := exec.Command("git", "show-ref", "--tags").Output()
|
||||||
if err != nil {
|
if err != nil && err.Error() != "exit status 1" {
|
||||||
|
// exit status 1 is returned when there are no tags, which should be ok for us
|
||||||
return fmt.Errorf("failed to get local tags: %s", err)
|
return fmt.Errorf("failed to get local tags: %s", err)
|
||||||
} else {
|
} else {
|
||||||
lines := strings.Split(strings.TrimSpace(string(output)), "\n")
|
lines := strings.Split(strings.TrimSpace(string(output)), "\n")
|
||||||
@@ -562,6 +564,7 @@ aside from those, there is also:
|
|||||||
log("- setting tag %s to commit %s\n", color.CyanString(tagName), color.CyanString(commitHash))
|
log("- setting tag %s to commit %s\n", color.CyanString(tagName), color.CyanString(commitHash))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// create and sign the new state event
|
// create and sign the new state event
|
||||||
newStateEvent := state.ToEvent()
|
newStateEvent := state.ToEvent()
|
||||||
|
|||||||
Reference in New Issue
Block a user