Merge branch 'master' of git://github.com/psionides/git-subtree
[gitweb.git] / git-subtree.sh
index 0a5cafa77f1acb5e0cd507864a615a065b77f0d6..66ce251eaafc41e607ee0dec37e8b172bf8f6c93 100755 (executable)
@@ -166,9 +166,9 @@ rev_is_descendant_of_branch()
        newrev="$1"
        branch="$2"
        branch_hash=$(git rev-parse $branch)
-       match=$(git rev-list $newrev | grep $branch_hash)
+       match=$(git rev-list -1 $branch_hash ^$newrev)
 
-       if [ -n "$match" ]; then
+       if [ -z "$match" ]; then
                return 0
        else
                return 1
@@ -317,7 +317,7 @@ rejoin_msg()
                commit_message="Split '$dir/' into commit '$latest_new'"
        fi
        cat <<-EOF
-               $message
+               $commit_message
                
                git-subtree-dir: $dir
                git-subtree-mainline: $latest_old