Subject: [PATCH 1/2] contrib/git-jump: extract function diff_to_quickfix

From: Beat Bolli <[email-masked]>
Date: Sat, 21 Dec 2019 12:38:45 +0100

In preparation for a new mode that will also jump to diff hunks, extract
the function that generates the quickfix list from a diff.

Signed-off-by: Beat Bolli <[email-masked]>
---
 contrib/git-jump/git-jump | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
 mode change 100755 => 100644 contrib/git-jump/git-jump

diff --git a/contrib/git-jump/git-jump b/contrib/git-jump/git-jump
old mode 100755
new mode 100644
index 931b0fe3a9..776fa90f7f
--- a/contrib/git-jump/git-jump
+++ b/contrib/git-jump/git-jump
@@ -24,7 +24,10 @@ open_editor() {
 }
 
 mode_diff() {
-	git diff --no-prefix --relative "$@" |
+	git diff --no-prefix --relative "$@" | diff_to_quickfix
+}
+
+diff_to_quickfix() {
 	perl -ne '
 	if (m{^\+\+\+ (.*)}) { $file = $1; next }
 	defined($file) or next;
-- 
2.21.0.1020.gf2820cf01a