From: Junio C Hamano Date: Wed, 27 Jul 2022 20:00:26 +0000 (-0700) Subject: Merge branch 'js/vimdiff-quotepath-fix' into maint X-Git-Tag: v2.37.2~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=57fe0df8a6295bc633f9fc4d2fa941900d9c109e;p=thirdparty%2Fgit.git Merge branch 'js/vimdiff-quotepath-fix' into maint Variable quoting fix in the vimdiff driver of "git mergetool" source: * js/vimdiff-quotepath-fix: mergetool(vimdiff): allow paths to contain spaces again --- 57fe0df8a6295bc633f9fc4d2fa941900d9c109e diff --cc mergetools/vimdiff index 461a89b6f9,f7e7f27028..fa82a8dca6 --- a/mergetools/vimdiff +++ b/mergetools/vimdiff @@@ -614,6 -614,37 +614,37 @@@ run_unit_tests () fi done + # 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 | split | vertical split | 1b | wincmd l | vertical split | quit | wincmd l | 2b | wincmd j | 3b | tabdo windo diffthis ++ 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