summaryrefslogtreecommitdiff
path: root/git-mergetool--lib.sh
diff options
context:
space:
mode:
authorMichael J Gruber <git@drmicha.warpmail.net>2011-02-25 10:36:39 +0100
committerJunio C Hamano <gitster@pobox.com>2011-02-25 12:00:28 -0800
commit853c0ffe42fef0bd1abd5cc69d5e93fdd5a708aa (patch)
tree642ce419edc2156230be962f95aea9c7e49daf3e /git-mergetool--lib.sh
parent7ed863a85a6ce2c4ac4476848310b8f917ab41f9 (diff)
downloadgit-853c0ffe42fef0bd1abd5cc69d5e93fdd5a708aa.tar.gz
mergetool-lib: call vim in readonly mode for diffs
When [g]vimdiff is called for files which are opened already, the editor complains about the existing swap file. But we do not want to write anything when called from difftool. So, make difftool use "-R" for the vim family. This - prevents the use of a swap file and - marks the buffers readonly. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-mergetool--lib.sh')
-rw-r--r--git-mergetool--lib.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index 77d4aee20e..78ce49e984 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -182,7 +182,7 @@ run_merge_tool () {
fi
check_unchanged
else
- "$merge_tool_path" -f -d -c "wincmd l" \
+ "$merge_tool_path" -R -f -d -c "wincmd l" \
"$LOCAL" "$REMOTE"
fi
;;
@@ -193,7 +193,7 @@ run_merge_tool () {
"$LOCAL" "$MERGED" "$REMOTE"
check_unchanged
else
- "$merge_tool_path" -f -d -c "wincmd l" \
+ "$merge_tool_path" -R -f -d -c "wincmd l" \
"$LOCAL" "$REMOTE"
fi
;;