From 38762c47d6442dc0ce0f45533f9151877c485337 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 28 Nov 2007 16:15:04 -0800 Subject: scripts: do not get confused with HEAD in work tree When you have a file called HEAD in your work tree, many commands that our scripts feed "HEAD" to would complain about the rev vs path ambiguity. A solution is to form command line more carefully by appending -- to them, which makes it clear that we mean HEAD rev not HEAD file. This patch would apply to maint. Signed-off-by: Junio C Hamano --- git-rebase.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'git-rebase.sh') diff --git a/git-rebase.sh b/git-rebase.sh index b0c8ac1c8d..c9b284c751 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -60,7 +60,7 @@ continue_merge () { fi cmt=`cat "$dotest/current"` - if ! git diff-index --quiet HEAD + if ! git diff-index --quiet HEAD -- then if ! git-commit -C "$cmt" then @@ -253,7 +253,7 @@ fi # The tree must be really really clean. git update-index --refresh || exit -diff=$(git diff-index --cached --name-status -r HEAD) +diff=$(git diff-index --cached --name-status -r HEAD --) case "$diff" in ?*) echo "cannot rebase: your index is not up-to-date" echo "$diff" -- cgit v1.2.3