- echo "Auto-merging $4"
- orig=$(git-unpack-file $1)
- src1=$(git-unpack-file $2)
- src2=$(git-unpack-file $3)
- merge "$src2" "$orig" "$src1"
+ echo "Auto-merging $4."
+ orig=`git-unpack-file $1`
+ src2=`git-unpack-file $3`
+
+ # We reset the index to the first branch, making
+ # git-diff-file useful
+ git-update-cache --add --cacheinfo "$6" "$2" "$4"
+ git-checkout-cache -u -f -- "$4" &&
+ merge "$4" "$orig" "$src2"