Code

Don't squash-merge if the old and new commits are the same.
authorAvery Pennarun <apenwarr@gmail.com>
Sat, 30 May 2009 07:33:17 +0000 (03:33 -0400)
committerAvery Pennarun <apenwarr@gmail.com>
Sat, 30 May 2009 07:33:17 +0000 (03:33 -0400)
git-subtree.sh

index 863e28bb74527d39b6278d4aa4798e78411c79e4..f7fe11117869460aad9f572cf0302b5f06ee0563 100755 (executable)
@@ -523,6 +523,10 @@ cmd_merge()
                set $first_split
                old=$1
                sub=$2
+               if [ "$sub" = "$rev" ]; then
+                       say "Subtree is already at commit $rev."
+                       exit 0
+               fi
                new=$(new_squash_commit "$old" "$sub" "$rev") || exit $?
                debug "New squash commit: $new"
                rev="$new"