Teach git-add and git-commit to handle filenames starting with '-'.
Recent '--' fixes to "git diff" by Linus made it possible to specify filenames that start with '-'. But in order to do that, you need to be able to add and commit such file to begin with. Teach git-add and git-commit to honor the same '--' convention. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Oct 18, 2005 at 00:27 UTC
4bfe1199eabb41eb1f1d67f4ee24df028eb21300
2 files changed
+3
-3
git-add.sh
+2
-2
@@ -23,10 +23,10 @@ if test -f "$GIT_DIR/info/exclude"
23
then
24
git-ls-files -z \
25
--exclude-from="$GIT_DIR/info/exclude" \
26
- --others --exclude-per-directory=.gitignore "$@"
26
+ --others --exclude-per-directory=.gitignore -- "$@"
27
else
28
git-ls-files -z \
29
- --others --exclude-per-directory=.gitignore "$@"
29
+ --others --exclude-per-directory=.gitignore -- "$@"
30
fi |
31
case "$show_only" in
32
true)
git-commit.sh
+1
-1
@@ -99,7 +99,7 @@ t,*)
99
,0)
100
;;
101
*)
102
- git-diff-files --name-only -z "$@" |
102
+ git-diff-files --name-only -z -- "$@" |
103
git-update-index --remove -z --stdin
104
;;
105
esac || exit 1