Skip to content

Commit

Permalink
Clarify kind of conflict in merge-one-file helper
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alex Riesen authored and Junio C Hamano committed May 9, 2009
1 parent ac9f71c commit 718135e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions git-merge-one-file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,22 +113,29 @@ case "${1:-.}${2:-.}${3:-.}" in
src1=`git-unpack-file $2`
git merge-file "$src1" "$orig" "$src2"
ret=$?
msg=
if [ $ret -ne 0 ]; then
msg='content conflict'
fi

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

if [ "$6" != "$7" ]; then
echo "ERROR: Permissions conflict: $5->$6,$7."
if [ -n "$msg" ]; then
msg="$msg, "
fi
msg="${msg}permissions conflict: $5->$6,$7"
ret=1
fi
if [ "$1" = '' ]; then
ret=1
fi

if [ $ret -ne 0 ]; then
echo "ERROR: Merge conflict in $4"
echo "ERROR: $msg in $4"
exit 1
fi
exec git update-index -- "$4"
Expand Down

0 comments on commit 718135e

Please sign in to comment.