summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1abb3f1)
raw | patch | inline | side by side (parent: 1abb3f1)
author | Junio C Hamano <junkio@cox.net> | |
Sat, 25 Jun 2005 09:24:50 +0000 (02:24 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Sat, 25 Jun 2005 23:52:16 +0000 (16:52 -0700) |
When a merge adds a file DF and removes a directory there by
deleting a path DF/DF, git-merge-one-file-script can be called
for the removal of DF/DF when the path DF is already created by
"git-read-tree -m -u". When this happens, we get confused by a
failure return from 'rm -f -- "$4"' (where $4 is DF/DF); finding
file DF there the "rm -f" command complains that DF is not a
directory.
What we want to ensure is that there is no file DF/DF in this
case. Avoid getting ourselves confused by first checking if
there is a file, and only then try to remove it (and check for
failure from the "rm" command).
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
deleting a path DF/DF, git-merge-one-file-script can be called
for the removal of DF/DF when the path DF is already created by
"git-read-tree -m -u". When this happens, we get confused by a
failure return from 'rm -f -- "$4"' (where $4 is DF/DF); finding
file DF there the "rm -f" command complains that DF is not a
directory.
What we want to ensure is that there is no file DF/DF in this
case. Avoid getting ourselves confused by first checking if
there is a file, and only then try to remove it (and check for
failure from the "rm" command).
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
git-merge-one-file-script | patch | blob | history |
index 88ad3edd64acf92dd11d690c110d42bef23a6187..9802f67032bde6bbd9edacb89f3a4acdf876deb9 100755 (executable)
#
"$1.." | "$1.$1" | "$1$1.")
echo "Removing $4"
- rm -f -- "$4" &&
- exec git-update-cache --remove -- "$4"
+ if test -f "$4"
+ then
+ rm -f -- "$4"
+ fi &&
+ exec git-update-cache --remove -- "$4"
;;
#