Skip to content

Commit 718135e

Browse files
raalkmlgitster
authored andcommitted
Clarify kind of conflict in merge-one-file helper
Not as verbose as the recursive merge driver, but better still. Signed-off-by: Alex Riesen <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ac9f71c commit 718135e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

git-merge-one-file.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,22 +113,29 @@ case "${1:-.}${2:-.}${3:-.}" in
113113
src1=`git-unpack-file $2`
114114
git merge-file "$src1" "$orig" "$src2"
115115
ret=$?
116+
msg=
117+
if [ $ret -ne 0 ]; then
118+
msg='content conflict'
119+
fi
116120

117121
# Create the working tree file, using "our tree" version from the
118122
# index, and then store the result of the merge.
119123
git checkout-index -f --stage=2 -- "$4" && cat "$src1" >"$4"
120124
rm -f -- "$orig" "$src1" "$src2"
121125

122126
if [ "$6" != "$7" ]; then
123-
echo "ERROR: Permissions conflict: $5->$6,$7."
127+
if [ -n "$msg" ]; then
128+
msg="$msg, "
129+
fi
130+
msg="${msg}permissions conflict: $5->$6,$7"
124131
ret=1
125132
fi
126133
if [ "$1" = '' ]; then
127134
ret=1
128135
fi
129136

130137
if [ $ret -ne 0 ]; then
131-
echo "ERROR: Merge conflict in $4"
138+
echo "ERROR: $msg in $4"
132139
exit 1
133140
fi
134141
exec git update-index -- "$4"

0 commit comments

Comments
 (0)