--- Junio C Hamano <junkio@cox.net> wrote:
However, there is a bug recently introduced in the
merge-one-file script.
Ok, if your patch below resolves the bug (please see my
other email just posted) please submit it. (I'm hitting
this bug everytime there's a file deleted from the
kernel tree and I try to merge.)
Thanks,
Luben
quoted hunk ↗ jump to hunk
Although the conflict resolution procedure I described applies
if you really had a real conflicting merge, I suspect your merge
should not have failed in the first place.
case "${1:-.}${2:-.}${3:-.}" in
#
# Deleted in both or deleted in one and unchanged in the other
#
"$1.." | "$1.$1" | "$1$1.")
if [ "$2" ]; then
echo "Removing $4"
fi
if test -f "$4"; then
rm -f -- "$4" &&
rmdir -p "$(expr "$4" : '\(.*\)/')" 2>/dev/null
fi &&
exec git-update-index --remove -- "$4"
;;
The faliure code from "rmdir -p" leaks up and makes
git-update-index to be skipped. Here is a fix.
-- >8 --
[PATCH] merge-one-file fix
9ae2172aed289f2706a0e88288909fa47eddd7e7 used "rmdir -p"
carelessly, causing the "git-update-index --remove" to be
skipped.
---diff --git a/git-merge-one-file.sh b/git-merge-one-file.sh
index 739a072..9a049f4 100755
--- a/git-merge-one-file.sh
+++ b/git-merge-one-file.sh
@@ -26,7 +26,7 @@ case "${1:-.}${2:-.}${3:-.}" in
fi
if test -f "$4"; then
rm -f -- "$4" &&
- rmdir -p "$(expr "$4" : '\(.*\)/')" 2>/dev/null
+ rmdir -p "$(expr "$4" : '\(.*\)/')" 2>/dev/null || :
fi &&
exec git-update-index --remove -- "$4"
;;
-To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html