Skip to content

Commit d67a127

Browse files
committed
Handle file names with spaces in git-show-merge-resolution script
1 parent 6de5c31 commit d67a127

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

git/git-show-merge-resolution.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ theirs=$1^2
2424
base=$(git merge-base $ours $theirs)
2525

2626
if $conflicts_only; then
27-
files=$(git show $1 | grep "diff --cc" | cut -d " " -f 3)
27+
files=$(git show $1 | grep "diff --cc" | cut -d " " -f 3-)
2828
else
29-
files=$(git merge-tree $base $ours $theirs | grep -A 3 "changed in both" | grep "base" | cut -d " " -f 8)
29+
files=$(git merge-tree $base $ours $theirs | grep -A 3 "changed in both" | grep "base" | cut -d " " -f 8-)
3030
fi
3131

3232
if [ -n "$files" ]; then
@@ -54,8 +54,8 @@ else
5454
fi
5555
fi
5656

57-
for f in $files; do
58-
echo $f
57+
for f in "$files"; do
58+
echo "$f"
5959
done
6060

6161
TOOL_MODE=merge

0 commit comments

Comments
 (0)