File tree Expand file tree Collapse file tree 1 file changed +35
-4
lines changed Expand file tree Collapse file tree 1 file changed +35
-4
lines changed Original file line number Diff line number Diff line change @@ -414,8 +414,8 @@ merge_cmd () {
414414
415415 if $base_present
416416 then
417- eval "$merge_tool_path" \
418- -f "$FINAL_CMD" "$LOCAL" "$BASE" "$REMOTE" "$MERGED"
417+ eval ' "$merge_tool_path"' \
418+ -f "$FINAL_CMD" ' "$LOCAL"' ' "$BASE"' ' "$REMOTE"' ' "$MERGED"'
419419 else
420420 # If there is no BASE (example: a merge conflict in a new file
421421 # with the same name created in both braches which didn't exist
@@ -424,8 +424,8 @@ merge_cmd () {
424424 FINAL_CMD=$(echo "$FINAL_CMD" | \
425425 sed -e 's:2b:quit:g' -e 's:3b:2b:g' -e 's:4b:3b:g')
426426
427- eval "$merge_tool_path" \
428- -f "$FINAL_CMD" "$LOCAL" "$REMOTE" "$MERGED"
427+ eval ' "$merge_tool_path"' \
428+ -f "$FINAL_CMD" ' "$LOCAL"' ' "$REMOTE"' ' "$MERGED"'
429429 fi
430430
431431 ret="$?"
@@ -614,6 +614,37 @@ run_unit_tests () {
614614 fi
615615 done
616616
617+ # verify that `merge_cmd` handles paths with spaces
618+ record_parameters () {
619+ >actual
620+ for arg
621+ do
622+ echo "$arg" >>actual
623+ done
624+ }
625+
626+ base_present=false
627+ LOCAL='lo cal'
628+ BASE='ba se'
629+ REMOTE="' '"
630+ MERGED='mer ged'
631+ merge_tool_path=record_parameters
632+
633+ merge_cmd vimdiff || at_least_one_ko=true
634+
635+ cat >expect <<-\EOF
636+ -f
637+ -c
638+ echo | leftabove split | leftabove vertical split | 1b | wincmd l | leftabove vertical split | quit | wincmd l | 2b | wincmd j | 3b | tabdo windo diffthis
639+ -c
640+ tabfirst
641+ lo cal
642+ ' '
643+ mer ged
644+ EOF
645+
646+ diff -u expect actual || at_least_one_ko=true
647+
617648 if test "$at_least_one_ko" = "true"
618649 then
619650 return 255
You can’t perform that action at this time.
0 commit comments