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-stash.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git-stash.sh') diff --git a/git-stash.sh b/git-stash.sh index 5bbda47b7..77c94210b 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -14,7 +14,7 @@ trap 'rm -f "$TMP-*"' 0 ref_stash=refs/stash no_changes () { - git diff-index --quiet --cached HEAD && + git diff-index --quiet --cached HEAD -- && git diff-files --quiet } -- cgit v1.2.1