From d1c89c7b3c303883528e3a2ca45d9b4daf1f1e71 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Tue, 24 Aug 2010 20:56:06 +0200 Subject: [PATCH] Fix pretty_tree to work in a subdirectory MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Without this change a freshly exported branch contains the .top* files when tg export was started from a subdirectory. Reported-by: Per Cederqvist Signed-off-by: Uwe Kleine-König --- tg-export.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tg-export.sh b/tg-export.sh index a16c290..6d82d55 100644 --- a/tg-export.sh +++ b/tg-export.sh @@ -67,10 +67,9 @@ trap 'rm -rf "$playground"' EXIT # Output tree ID of a cleaned-up tree without tg's artifacts. pretty_tree() { - (export GIT_INDEX_FILE="$playground/^index" - git read-tree "$1" - git update-index --force-remove ".topmsg" ".topdeps" - git write-tree) + git ls-tree --full-tree "$1" \ + | awk -F ' ' '$2 !~ /^.top/' \ + | git mktree } create_tg_commit() -- 2.30.2