From 1a8c36dc5fdd8c439c65f18a91ad211050201fc8 Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Sat, 30 May 2009 03:33:39 -0400 Subject: [PATCH] Fix splitting after using a squash merge. --- git-subtree.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 -- 2.26.2