Skip to content

Commit 05e74f4

Browse files
committed
Merge branch 'pr/mergetool'
* pr/mergetool: Open external merge tool with original file extensions for all three files
2 parents 9b433e4 + c3d51cd commit 05e74f4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

git-mergetool.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,11 @@ merge_file () {
152152
exit 1
153153
fi
154154

155-
BACKUP="$path.BACKUP.$$"
156-
LOCAL="$path.LOCAL.$$"
157-
REMOTE="$path.REMOTE.$$"
158-
BASE="$path.BASE.$$"
155+
ext="$$$(expr "$path" : '.*\(\.[^/]*\)$')"
156+
BACKUP="$path.BACKUP.$ext"
157+
LOCAL="$path.LOCAL.$ext"
158+
REMOTE="$path.REMOTE.$ext"
159+
BASE="$path.BASE.$ext"
159160

160161
mv -- "$path" "$BACKUP"
161162
cp -- "$BACKUP" "$path"

0 commit comments

Comments
 (0)