]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'js/vimdiff-quotepath-fix'
authorJunio C Hamano <gitster@pobox.com>
Fri, 22 Jul 2022 22:04:02 +0000 (15:04 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 22 Jul 2022 22:04:02 +0000 (15:04 -0700)
Variable quoting fix in the vimdiff driver of "git mergetool"

* js/vimdiff-quotepath-fix:
  mergetool(vimdiff): allow paths to contain spaces again

1  2 
mergetools/vimdiff

index b045b10fd75b6483283af292812f41fa2d9ba6dd,f7e7f2702857d0908b4ca278acf2474d77942b74..f770b8fe244c8ddd9dc349125a8e8e0ac0325574
@@@ -614,6 -614,37 +614,37 @@@ run_unit_tests () 
                fi
        done
  
 -      echo | split | vertical split | 1b | wincmd l | vertical split | quit | wincmd l | 2b | wincmd j | 3b | tabdo windo diffthis
+       # verify that `merge_cmd` handles paths with spaces
+       record_parameters () {
+               >actual
+               for arg
+               do
+                       echo "$arg" >>actual
+               done
+       }
+       base_present=false
+       LOCAL='lo cal'
+       BASE='ba se'
+       REMOTE="' '"
+       MERGED='mer ged'
+       merge_tool_path=record_parameters
+       merge_cmd vimdiff || at_least_one_ko=true
+       cat >expect <<-\EOF
+       -f
+       -c
++      echo | leftabove split | leftabove vertical split | 1b | wincmd l | leftabove vertical split | quit | wincmd l | 2b | wincmd j | 3b | tabdo windo diffthis
+       -c
+       tabfirst
+       lo cal
+       ' '
+       mer ged
+       EOF
+       diff -u expect actual || at_least_one_ko=true
        if test "$at_least_one_ko" = "true"
        then
                return 255