From: Avery Pennarun Date: Sat, 30 May 2009 07:33:39 +0000 (-0400) Subject: Fix splitting after using a squash merge. X-Git-Tag: v1.7.11-rc0~176^2~53 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1a8c36dc5fdd8c439c65f18a91ad211050201fc8;p=git.git Fix splitting after using a squash merge. --- diff --git a/git-subtree.sh b/git-subtree.sh index f7fe11117..1fff10e85 100755 --- a/git-subtree.sh +++ b/git-subtree.sh @@ -203,13 +203,17 @@ find_existing_splits() dir="$1" revs="$2" git log --grep="^git-subtree-dir: $dir\$" \ - --pretty=format:'%s%n%n%b%nEND%n' $revs | + --pretty=format:'START %H%n%s%n%n%b%nEND%n' $revs | while read a b junk; do case "$a" in - START) main="$b" ;; + START) main="$b"; sq="$b" ;; git-subtree-mainline:) main="$b" ;; git-subtree-split:) sub="$b" ;; END) + if [ -z "$main" -a -n "$sub" ]; then + # squash commits refer to a subtree + cache_set "$sq" "$sub" + fi if [ -n "$main" -a -n "$sub" ]; then debug " Prior: $main -> $sub" cache_set $main $sub