X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-mergetool.sh;h=cbbb707959cc64427f7bbd7bfefb0a8f0f263596;hb=5c66d0d4580196094e80c552f141525759a8e249;hp=5587c5ecea0f6a97f2715636890c9e2f89845d52;hpb=08e1812db1585c450bfe7f41e7106222346c88da;p=git.git diff --git a/git-mergetool.sh b/git-mergetool.sh index 5587c5ece..cbbb70795 100755 --- a/git-mergetool.sh +++ b/git-mergetool.sh @@ -152,10 +152,11 @@ merge_file () { exit 1 fi - BACKUP="$path.BACKUP.$$" - LOCAL="$path.LOCAL.$$" - REMOTE="$path.REMOTE.$$" - BASE="$path.BASE.$$" + ext="$$$(expr "$path" : '.*\(\.[^/]*\)$')" + BACKUP="$path.BACKUP.$ext" + LOCAL="$path.LOCAL.$ext" + REMOTE="$path.REMOTE.$ext" + BASE="$path.BASE.$ext" mv -- "$path" "$BACKUP" cp -- "$BACKUP" "$path" @@ -392,8 +393,11 @@ if test $# -eq 0 ; then echo "No files need merging" exit 0 fi - echo Merging the files: $files - git ls-files -u | sed -e 's/^[^ ]* //' | sort -u | while read i + echo Merging the files: "$files" + git ls-files -u | + sed -e 's/^[^ ]* //' | + sort -u | + while IFS= read i do printf "\n" merge_file "$i" < /dev/tty > /dev/tty