From 82f212d851a1be500921360f5e770c64b6e7f00f Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Fri, 18 Mar 2011 20:27:49 +0300 Subject: [PATCH] tg-export.sh: support tag objects as parent Currently tg-export fails with Collapsing u/quota-pull fatal: 2770ca86dec8b9cc36bf50127e5aff7f29557e3c is not a valid 'commit' object Check for and resolve tag objects for parent. Signed-off-by: Andrey Borzenkov --- tg-export.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tg-export.sh b/tg-export.sh index 486ec94..4574882 100644 --- a/tg-export.sh +++ b/tg-export.sh @@ -95,7 +95,8 @@ collapsed_commit() >"$playground/^body" # Determine parent - parent="$(cut -f 1 "$playground/$name^parents")" + parent="$(cut -f 1 "$playground/$name^parents" | \ + while read p; do [ $(git cat-file -t $p 2> /dev/null) = tag ] && git cat-file tag $p | head -1 | cut -d' ' -f2 || echo $p; done)" if [ "$(cat "$playground/$name^parents" | wc -l)" -gt 1 ]; then # Produce a merge commit first parent="$({ -- 2.11.4.GIT