git-jump: ignore (custom) prefix in diff mode

Matching the default file prefix b/ does not yield any results if config
option diff.noprefix or diff.mnemonicprefix is enabled.

Signed-off-by: Mischa POSLAWSKY <git@shiar.nl>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Mischa POSLAWSKY 2012-09-17 03:21:55 +02:00 committed by Junio C Hamano
parent 2ce4fee878
commit 6108b04b70

View file

@ -21,9 +21,9 @@ open_editor() {
}
mode_diff() {
git diff --relative "$@" |
git diff --no-prefix --relative "$@" |
perl -ne '
if (m{^\+\+\+ b/(.*)}) { $file = $1; next }
if (m{^\+\+\+ (.*)}) { $file = $1; next }
defined($file) or next;
if (m/^@@ .*\+(\d+)/) { $line = $1; next }
defined($line) or next;