summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Avery Pennarun <apenwarr@gmail.com>2009-05-30 03:33:17 -0400
committerLibravatar Avery Pennarun <apenwarr@gmail.com>2009-05-30 03:33:17 -0400
commiteb4fb91094cf5e20bf7570da3fadb50e444284bc (patch)
treefd3e963ddb9dd887c498696919e97c47e072714b
parentBasic "subtree merge --squash" support. (diff)
downloadtgif-eb4fb91094cf5e20bf7570da3fadb50e444284bc.tar.xz
Don't squash-merge if the old and new commits are the same.
-rwxr-xr-xgit-subtree.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/git-subtree.sh b/git-subtree.sh
index 863e28bb74..f7fe111178 100755
--- a/git-subtree.sh
+++ b/git-subtree.sh
@@ -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"