3 # This is the git merge script, called with
5 # $1 - original file (or empty string)
6 # $2 - file in branch1 (or empty string)
7 # $3 - file in branch2 (or empty string)
8 # $4 - pathname in repository
11 # Case 1: file removed in both
13 if [ -z "$2$3" ]; then
15 update-cache --remove -- "$4"
19 # Case 2: file exists in just one
21 if [ "$2$3" == "$3$2" ]; then
23 update-cache --add -- "$4"
27 # Case 3: file exists in both
33 echo "Auto-merging $4"
35 merge "$4" "$src" "$2" && update-cache --add -- "$4"