From f678dd180a037283decb76201b537dca24de848f Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 25 Nov 2005 13:33:14 -0800 Subject: 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 --- git-commit.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'git-commit.sh') diff --git a/git-commit.sh b/git-commit.sh index 41955e8e6..27aea80a4 100755 --- a/git-commit.sh +++ b/git-commit.sh @@ -92,10 +92,13 @@ tt*) esac case "$all,$#" in -t,*) +t,0) git-diff-files --name-only -z | git-update-index --remove -z --stdin ;; +t,*) + die "Cannot use -a and explicit files at the same time." + ;; ,0) ;; *) -- cgit v1.2.1 From ae2b0f15180d4b044828c836bcab6a990efa5c8e Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 24 Nov 2005 00:12:11 -0800 Subject: git-sh-setup: die if outside git repository. Now all the users of this script detect its exit status and die, complaining that it is outside git repository. So move the code that dies from all callers to git-sh-setup script. Signed-off-by: Junio C Hamano --- git-commit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git-commit.sh') diff --git a/git-commit.sh b/git-commit.sh index 27aea80a4..3d250ec85 100755 --- a/git-commit.sh +++ b/git-commit.sh @@ -3,7 +3,7 @@ # Copyright (c) 2005 Linus Torvalds # -. git-sh-setup || die "Not a git archive" +. git-sh-setup usage () { die 'git commit [-a] [-s] [-v | --no-verify] [-m | -F | (-C|-c) ] [-e] [...]' -- cgit v1.2.1