From 2967284456e9053ee8dd26148c22432a4776a3dc Mon Sep 17 00:00:00 2001
From: David Aguilar <davvid@gmail.com>
Date: Tue, 29 Nov 2016 01:38:20 -0800
Subject: [PATCH] mergetools/vimdiff: trust Vim's exit code

Allow vimdiff users to signal that they do not want to use the
result of a merge by exiting with ":cquit", which tells Vim to
exit with an error code.

This is better than the current behavior because it allows users
to directly flag that the merge is bad, using a standard Vim
feature, rather than relying on a timestamp heuristic that is
unforgiving to users that save in-progress merge files.

The original behavior can be restored by configuring
mergetool.vimdiff.trustExitCode to false.

Reported-by: Dun Peal <dunpealer@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 mergetools/vimdiff | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/mergetools/vimdiff b/mergetools/vimdiff
index a841ffdb49..10d86f3e19 100644
--- a/mergetools/vimdiff
+++ b/mergetools/vimdiff
@@ -42,3 +42,7 @@ translate_merge_tool_path() {
 		;;
 	esac
 }
+
+exit_code_trustable () {
+	true
+}