t3703, t4208: add test cases for magic pathspec
[gitweb.git] / git-mergetool--lib.sh
index efca09f51f58f289815402bfe84b04e12149904b..fb3f52ba2507b4fb78db150b5c183f24bd2c57c1 100644 (file)
@@ -13,6 +13,9 @@ translate_merge_tool_path () {
        araxis)
                echo compare
                ;;
+       bc3)
+               echo bcompare
+               ;;
        emerge)
                echo emacs
                ;;
@@ -46,7 +49,7 @@ check_unchanged () {
 
 valid_tool () {
        case "$1" in
-       araxis | diffuse | ecmerge | emerge | gvimdiff | gvimdiff2 | \
+       araxis | bc3 | diffuse | ecmerge | emerge | gvimdiff | gvimdiff2 | \
        kdiff3 | meld | opendiff | p4merge | tkdiff | vimdiff | vimdiff2 | xxdiff)
                ;; # happy
        kompare)
@@ -106,6 +109,21 @@ run_merge_tool () {
                                >/dev/null 2>&1
                fi
                ;;
+       bc3)
+               if merge_mode; then
+                       touch "$BACKUP"
+                       if $base_present; then
+                               "$merge_tool_path" "$LOCAL" "$REMOTE" "$BASE" \
+                                       -mergeoutput="$MERGED"
+                       else
+                               "$merge_tool_path" "$LOCAL" "$REMOTE" \
+                                       -mergeoutput="$MERGED"
+                       fi
+                       check_unchanged
+               else
+                       "$merge_tool_path" "$LOCAL" "$REMOTE"
+               fi
+               ;;
        diffuse)
                if merge_mode; then
                        touch "$BACKUP"
@@ -169,7 +187,7 @@ run_merge_tool () {
                        fi
                        check_unchanged
                else
-                       "$merge_tool_path" -f -d -c "wincmd l" \
+                       "$merge_tool_path" -R -f -d -c "wincmd l" \
                                "$LOCAL" "$REMOTE"
                fi
                ;;
@@ -180,7 +198,7 @@ run_merge_tool () {
                                "$LOCAL" "$MERGED" "$REMOTE"
                        check_unchanged
                else
-                       "$merge_tool_path" -f -d -c "wincmd l" \
+                       "$merge_tool_path" -R -f -d -c "wincmd l" \
                                "$LOCAL" "$REMOTE"
                fi
                ;;
@@ -342,7 +360,7 @@ guess_merge_tool () {
                else
                        tools="opendiff kdiff3 tkdiff xxdiff meld $tools"
                fi
-               tools="$tools gvimdiff diffuse ecmerge p4merge araxis"
+               tools="$tools gvimdiff diffuse ecmerge p4merge araxis bc3"
        fi
        case "${VISUAL:-$EDITOR}" in
        *vim*)