- echo "Auto-merging $4"
- orig=$(unpack-file $1)
- src1=$(unpack-file $2)
- src2=$(unpack-file $3)
- merge "$src2" "$orig" "$src1" || echo Leaving conflict merge in $src2 && exit 1
- cp "$src2" "$4" && update-cache --add -- "$4" && exit 0
- ;;
-
+ echo "Auto-merging $4."
+ orig=`git-unpack-file $1`
+ src1=`git-unpack-file $2`
+ src2=`git-unpack-file $3`
+ merge "$src2" "$orig" "$src1"
+ ret=$?
+ if [ "$6" != "$7" ]; then
+ echo "ERROR: Permissions $5->$6->$7 don't match."
+ fi
+ if [ $ret -ne 0 ]; then
+ echo "ERROR: Leaving conflict merge in $src2."
+ exit 1
+ fi
+ sha1=`git-write-blob "$src2"` || {
+ echo "ERROR: Leaving conflict merge in $src2."
+ }
+ exec git-update-cache --add --cacheinfo "$6" $sha1 "$4" ;;