Merge remote branch 'origin/master'
authorAvery Pennarun <apenwarr@gmail.com>
Thu, 24 Jun 2010 06:11:04 +0000 (02:11 -0400)
committerAvery Pennarun <apenwarr@gmail.com>
Thu, 24 Jun 2010 06:11:04 +0000 (02:11 -0400)
* origin/master:
Fixed regression with splitting out new subtree
Use 'git merge -Xsubtree' when git version >= 1.7.0.

1  2 
git-subtree.sh
diff --combined git-subtree.sh
index 935dfca7f36c1283c04a1ab06ba866725fe40210,a86cfd8b9f8fd9a50e577f0612fea7a7a2b90213..a15d91ffb1b3d3318409619449745dbcfb393abf
@@@ -29,12 -29,8 +29,12 @@@ rejoin        merge the new branch bac
  squash        merge subtree changes as a single commit
  "
  eval $(echo "$OPTS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)
 +
 +OPATH=$PATH
  PATH=$(git --exec-path):$PATH
  . git-sh-setup
 +PATH=$OPATH  # apparently needed for some versions of msysgit
 +
  require_work_tree
  
  quiet=
@@@ -257,6 -253,7 +257,7 @@@ find_existing_splits(
                                if [ -n "$main" -a -n "$sub" ]; then
                                        debug "  Prior: $main -> $sub"
                                        cache_set $main $sub
+                                       cache_set $sub $sub
                                        try_remove_previous "$main"
                                        try_remove_previous "$sub"
                                fi
@@@ -573,7 -570,9 +574,9 @@@ cmd_split(
                # ugly.  is there no better way to tell if this is a subtree
                # vs. a mainline commit?  Does it matter?
                if [ -z $tree ]; then
-                       cache_set $rev $rev
+                       if [ -n "$newparents" ]; then
+                               cache_set $rev $rev
+                       fi
                        continue
                fi
  
@@@ -638,11 -637,20 +641,20 @@@ cmd_merge(
                debug "New squash commit: $new"
                rev="$new"
        fi
-       
-       if [ -n "$message" ]; then
-               git merge -s subtree --message="$message" $rev
+       version=$(git version)
+       if [ "$version" \< "git version 1.7" ]; then
+               if [ -n "$message" ]; then
+                       git merge -s subtree --message="$message" $rev
+               else
+                       git merge -s subtree $rev
+               fi
        else
-               git merge -s subtree $rev
+               if [ -n "$message" ]; then
+                       git merge -Xsubtree="$prefix" --message="$message" $rev
+               else
+                       git merge -Xsubtree="$prefix" $rev
+               fi
        fi
  }