summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apkgrel.in7
1 files changed, 5 insertions, 2 deletions
diff --git a/apkgrel.in b/apkgrel.in
index 57b3b93..28978e3 100644
--- a/apkgrel.in
+++ b/apkgrel.in
@@ -62,7 +62,7 @@ Usage: $prog [-z|--zero] [-a|--add] [-g|--clean-git] [-s|--set NUM] [-t|--test]
Options:
-z, --zero Set pkgrel to 0
-a, --add Add 1 to current pkgrel
- -g, --clean-git Only operate on APKBUILDs with clean git status
+ -g, --clean-git Only operate on APKBUILDs with clean git status (implies --add)
-s, --set NUM Set pkgrel to NUM
-t, --test Only verify that files have a valid pkgrel
-f, --force Operate on files without a valid pkgrel
@@ -86,7 +86,10 @@ while true; do
case $1 in
-z|--zero) setto=0; cmd=do_set;;
-a|--add) cmd=do_add;;
- -g|--clean-git) only_clean_git=1;;
+ -g|--clean-git) # verify that we're in a git tree
+ git rev-parse 2>/dev/null || die "not in a git tree"
+ cmd=do_add
+ only_clean_git=1;;
-s|--set) setto=$2; shift; cmd=do_set;;
-t|--test) cmd=do_nothing;;
-f|--force) force=1;;