]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'js/vimdiff-quotepath-fix' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 27 Jul 2022 20:00:26 +0000 (13:00 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 Jul 2022 20:00:26 +0000 (13:00 -0700)
Variable quoting fix in the vimdiff driver of "git mergetool"
source: <pull.1287.v2.git.1657809063728.gitgitgadget@gmail.com>

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

1  2 
mergetools/vimdiff

index 461a89b6f987972c6447a1e6d8df074aedddf814,f7e7f2702857d0908b4ca278acf2474d77942b74..fa82a8dca6a958efa0afcbed69489ac4e9903c76
@@@ -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