summaryrefslogtreecommitdiff
path: root/doTag.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-17 01:08:30 -0500
committerJeff Carr <[email protected]>2025-09-17 01:08:30 -0500
commitce0fd10064440ebce0fe4941bb15cf4beb14540a (patch)
tree738c8d52819fb7158762480a68962efd0312e6cd /doTag.go
parentae2cbf1886cb6bd71647c7d6ce1ed55f016c5618 (diff)
common argv handling
Diffstat (limited to 'doTag.go')
-rw-r--r--doTag.go16
1 files changed, 11 insertions, 5 deletions
diff --git a/doTag.go b/doTag.go
index 8d0692a..161a581 100644
--- a/doTag.go
+++ b/doTag.go
@@ -24,14 +24,20 @@ func FindRepoByFullPath(wd string) *gitpb.Repo {
return nil
}
+func findCurrentPwdRepoOrDie() *gitpb.Repo {
+ wd, err := os.Getwd()
+ repo := FindRepoByFullPath(wd)
+ if repo == nil {
+ log.Info("Could not find repo:", wd)
+ badExit(err)
+ }
+ return repo
+}
+
func doTag() error {
wd, _ := os.Getwd()
if argv.Tag.List != nil {
- repo := FindRepoByFullPath(wd)
- if repo == nil {
- log.Info("Could not find repo:", wd)
- return nil
- }
+ repo := findCurrentPwdRepoOrDie()
tagTablePB := makeTagTablePB(repo.Tags)
// tbox := win.Bottom.Box().SetProgName("TBOX")