Skip to content

Commit 6cc174d

Browse files
germanopjeffpc
authored andcommitted
[PATCH] Fix import-commit command line options check
Now usage if finally shown and we do not try to run git rev-list if the options are not the right ones. Previous check was based just on the number of arguments on the command line, hence "-h" was treated as something to feed git with. Signed-off-by: Germano Percossi <[email protected]> [jeffpc: collapse -h and --help into a single case] Signed-off-by: Josef 'Jeff' Sipek <[email protected]>
1 parent ac661a1 commit 6cc174d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

guilt-import-commit

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ fi
1111

1212
_main() {
1313

14+
while [ $# -gt 0 ]; do
15+
case "$1" in
16+
-h|--help)
17+
usage ;;
18+
-*)
19+
usage ;;
20+
*)
21+
break
22+
esac
23+
done
24+
1425
if [ $# -ne 1 ] || [ -z "$1" ]; then
1526
die "You must specify a range of commits"
1627
fi

0 commit comments

Comments
 (0)