@matheusbsbs / matheus-bagliano / commits / 718135e3b6
Fork 0

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 <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Alex Riesen committed Apr 29, 2009 at 23:40 UTC 718135e3b6b5317f763477f5b0f408d888d79a8e
1 file changed +9 -2
git-merge-one-file.sh
+9 -2
@@ -113,6 +113,10 @@ case "${1:-.}${2:-.}${3:-.}" in
113 src1=`git-unpack-file $2`
114 git merge-file "$src1" "$orig" "$src2"
115 ret=$?
116 + msg=
117 + if [ $ret -ne 0 ]; then
118 + msg='content conflict'
119 + fi
120
121 # Create the working tree file, using "our tree" version from the
122 # index, and then store the result of the merge.
@@ -120,7 +124,10 @@ case "${1:-.}${2:-.}${3:-.}" in
124 rm -f -- "$orig" "$src1" "$src2"
125
126 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"
131 ret=1
132 fi
133 if [ "$1" = '' ]; then
@@ -128,7 +135,7 @@ case "${1:-.}${2:-.}${3:-.}" in
135 fi
136
137 if [ $ret -ne 0 ]; then
131 - echo "ERROR: Merge conflict in $4"
138 + echo "ERROR: $msg in $4"
139 exit 1
140 fi
141 exec git update-index -- "$4"