Merge branch 'gh/git-jump-pathname-with-sp'

"git jump" (in contrib/) fails to parse the diff header correctly
when a file has a space in its name, which has been corrected.

* gh/git-jump-pathname-with-sp:
  git-jump: make `diff` work with filenames containing spaces
This commit is contained in:
Junio C Hamano
2025-08-22 13:13:20 -07:00

View File

@@ -44,7 +44,7 @@ open_editor() {
mode_diff() {
git diff --no-prefix --relative "$@" |
perl -ne '
if (m{^\+\+\+ (.*)}) { $file = $1 eq "/dev/null" ? undef : $1; next }
if (m{^\+\+\+ (.*?)\t?$}) { $file = $1 eq "/dev/null" ? undef : $1; next }
defined($file) or next;
if (m/^@@ .*?\+(\d+)/) { $line = $1; next }
defined($line) or next;