@matheusbsbs / matheus-bagliano / commits / f678dd180a
Fork 0

Prevent "git-commit -a path1 path2..."

When you want to create a partial commit, giving -a by mistake would ignore the given path. Prevent it. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Nov 25, 2005 at 13:33 UTC f678dd180a037283decb76201b537dca24de848f
1 file changed +4 -1
git-commit.sh
+4 -1
@@ -92,10 +92,13 @@ tt*)
92 esac
93
94 case "$all,$#" in
95 -t,*)
95 +t,0)
96 git-diff-files --name-only -z |
97 git-update-index --remove -z --stdin
98 ;;
99 +t,*)
100 + die "Cannot use -a and explicit files at the same time."
101 + ;;
102 ,0)
103 ;;
104 *)