chiark / gitweb /
Fix pretty_tree to work in a subdirectory
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 24 Aug 2010 18:56:06 +0000 (20:56 +0200)
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 24 Aug 2010 18:56:06 +0000 (20:56 +0200)
Without this change a freshly exported branch contains the .top* files
when tg export was started from a subdirectory.

Reported-by: Per Cederqvist <ceder@lysator.liu.se>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
tg-export.sh

index a16c290..6d82d55 100644 (file)
@@ -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()