Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-07-09 01:42:05 +0400
committerJunio C Hamano <gitster@pobox.com>2007-07-09 05:24:19 +0400
commit561b0fbb4a2d336faeb929380bddd6ec420d7b11 (patch)
tree1d7055f97fc27809e3f90fef9c2d9193bb6cd4be /git-merge-one-file.sh
parenta7342913e21a96597f38ce0b48e3093c9739df1f (diff)
Fix merge-one-file for our-side-added/our-side-removed cases
When commit ed93b449 changed the script so that it does not touch untracked working tree file, we forgot that we still needed to resolve the index entry (otherwise they are left unmerged). Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-merge-one-file.sh')
-rwxr-xr-xgit-merge-one-file.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/git-merge-one-file.sh b/git-merge-one-file.sh
index ebbb575965..1e7727d276 100755
--- a/git-merge-one-file.sh
+++ b/git-merge-one-file.sh
@@ -27,8 +27,9 @@ case "${1:-.}${2:-.}${3:-.}" in
# read-tree checked that index matches HEAD already,
# so we know we do not have this path tracked.
# there may be an unrelated working tree file here,
- # which we should just leave unmolested.
- exit 0
+ # which we should just leave unmolested. Make sure
+ # we do not have it in the index, though.
+ exec git update-index --remove -- "$4"
fi
if test -f "$4"; then
rm -f -- "$4" &&
@@ -42,7 +43,8 @@ case "${1:-.}${2:-.}${3:-.}" in
#
".$2.")
# the other side did not add and we added so there is nothing
- # to be done.
+ # to be done, except making the path merged.
+ exec git update-index --add --cacheinfo "$6" "$2" "$4"
;;
"..$3")
echo "Adding $4"
@@ -50,7 +52,7 @@ case "${1:-.}${2:-.}${3:-.}" in
echo "ERROR: untracked $4 is overwritten by the merge."
exit 1
}
- git update-index --add --cacheinfo "$6$7" "$2$3" "$4" &&
+ git update-index --add --cacheinfo "$7" "$3" "$4" &&
exec git checkout-index -u -f -- "$4"
;;