File tree 1 file changed +35
-4
lines changed
1 file changed +35
-4
lines changed Original file line number Diff line number Diff line change @@ -414,8 +414,8 @@ merge_cmd () {
414
414
415
415
if $base_present
416
416
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"'
419
419
else
420
420
# If there is no BASE (example: a merge conflict in a new file
421
421
# with the same name created in both braches which didn't exist
@@ -424,8 +424,8 @@ merge_cmd () {
424
424
FINAL_CMD=$(echo "$FINAL_CMD" | \
425
425
sed -e 's:2b:quit:g' -e 's:3b:2b:g' -e 's:4b:3b:g')
426
426
427
- eval "$merge_tool_path" \
428
- -f "$FINAL_CMD" "$LOCAL" "$REMOTE" "$MERGED"
427
+ eval ' "$merge_tool_path"' \
428
+ -f "$FINAL_CMD" ' "$LOCAL"' ' "$REMOTE"' ' "$MERGED"'
429
429
fi
430
430
431
431
ret="$?"
@@ -614,6 +614,37 @@ run_unit_tests () {
614
614
fi
615
615
done
616
616
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
+
617
648
if test "$at_least_one_ko" = "true"
618
649
then
619
650
return 255
You can’t perform that action at this time.
0 commit comments