Merge branch 'da/mergetool-temporary-filename'

Tweak the names of the three throw-away files "git mergetool" comes
up with to feed the merge tool backend, so that a file with a
single dot in its name in the original (e.g. "hello.c") will have
only one dot in these variants (e.g. "hello_BASE_4321.c").

* da/mergetool-temporary-filename:
  mergetool: use more conservative temporary filenames
maint
Junio C Hamano 2014-10-21 13:28:19 -07:00
commit 02f4db83bd
1 changed files with 11 additions and 5 deletions

View File

@ -228,11 +228,17 @@ merge_file () {
return 1 return 1
fi fi


ext="$$$(expr "$MERGED" : '.*\(\.[^/]*\)$')" if BASE=$(expr "$MERGED" : '\(.*\)\.[^/]*$')
BACKUP="./$MERGED.BACKUP.$ext" then
LOCAL="./$MERGED.LOCAL.$ext" ext=$(expr "$MERGED" : '.*\(\.[^/]*\)$')
REMOTE="./$MERGED.REMOTE.$ext" else
BASE="./$MERGED.BASE.$ext" BASE=$MERGED
ext=
fi
BACKUP="./${BASE}_BACKUP_$$$ext"
LOCAL="./${BASE}_LOCAL_$$$ext"
REMOTE="./${BASE}_REMOTE_$$$ext"
BASE="./${BASE}_BASE_$$$ext"


base_mode=$(git ls-files -u -- "$MERGED" | awk '{if ($3==1) print $1;}') base_mode=$(git ls-files -u -- "$MERGED" | awk '{if ($3==1) print $1;}')
local_mode=$(git ls-files -u -- "$MERGED" | awk '{if ($3==2) print $1;}') local_mode=$(git ls-files -u -- "$MERGED" | awk '{if ($3==2) print $1;}')