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>
This commit is contained in:
Michael J Gruber 2011-02-25 10:36:39 +01:00 коммит произвёл Junio C Hamano
Родитель 7ed863a85a
Коммит 853c0ffe42
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -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
;;