From fdeb6bf55b7c578ce1735092c6dfbf6968cbee5c Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 26 Apr 2006 02:27:59 -0700 Subject: [PATCH 1/3] t0000-basic: Add ls-tree recursive test back. When we updated ls-tree recursive output to omit the tree nodes, 246cc52f388cae8ca99e5a12b8458c9bfa467765 adjusted the old test so that we do not expect to see trees in its output. Later, with 0f8f45cb4a7e664b396f73c25891da46b953b8b8, we added back the ability to show both with -t option, but we forgot to update the test as well. Signed-off-by: Junio C Hamano --- t/t0000-basic.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index 6729a18266..c69706fb38 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -174,6 +174,27 @@ test_expect_success \ 'git-ls-tree -r output for a known tree.' \ 'diff current expected' +# But with -r -t we can have both. +test_expect_success \ + 'showing tree with git-ls-tree -r -t' \ + 'git-ls-tree -r -t $tree >current' +cat >expected <<\EOF +100644 blob f87290f8eb2cbbea7857214459a0739927eab154 path0 +120000 blob 15a98433ae33114b085f3eb3bb03b832b3180a01 path0sym +040000 tree 58a09c23e2ca152193f2786e06986b7b6712bdbe path2 +100644 blob 3feff949ed00a62d9f7af97c15cd8a30595e7ac7 path2/file2 +120000 blob d8ce161addc5173867a3c3c730924388daedbc38 path2/file2sym +040000 tree 21ae8269cacbe57ae09138dcc3a2887f904d02b3 path3 +100644 blob 0aa34cae68d0878578ad119c86ca2b5ed5b28376 path3/file3 +120000 blob 8599103969b43aff7e430efea79ca4636466794f path3/file3sym +040000 tree 3c5e5399f3a333eddecce7a9b9465b63f65f51e2 path3/subp3 +100644 blob 00fb5908cb97c2564a9783c0c64087333b3b464f path3/subp3/file3 +120000 blob 6649a1ebe9e9f1c553b66f5a6e74136a07ccc57c path3/subp3/file3sym +EOF +test_expect_success \ + 'git-ls-tree -r output for a known tree.' \ + 'diff current expected' + ################################################################ rm .git/index test_expect_success \ From 2d86d2c6fcbd62696447fe3dbfac664e6c82b0ce Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 26 Apr 2006 03:12:58 -0700 Subject: [PATCH 2/3] Makefile: remove and create xdiff library from scratch. ... in the same spirit as 71459c193d04870076efa0a387c317390b53e3e2. Signed-off-by: Junio C Hamano --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 087ff27c28..8ce27a65fb 100644 --- a/Makefile +++ b/Makefile @@ -580,7 +580,7 @@ $(LIB_FILE): $(LIB_OBJS) XDIFF_OBJS=xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o $(XDIFF_LIB): $(XDIFF_OBJS) - $(AR) rcs $@ $(XDIFF_OBJS) + rm -f $@ && $(AR) rcs $@ $(XDIFF_OBJS) doc: From 3496277a561307c3d31d2085347af8eb4c667c36 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 26 Apr 2006 03:18:51 -0700 Subject: [PATCH 3/3] commit-tree: allow generic object name for the tree as well. We use get_sha1() for -p (parent) objects, but still used get_sha1_hex() for the tree. Just to be consistent, allow extended SHA1 expression for the tree object name. Note that this is not to encourage funky things like this: git-commit-tree HEAD^{tree} -p HEAD Signed-off-by: Junio C Hamano --- commit-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit-tree.c b/commit-tree.c index 2d8651894a..e91af4bd36 100644 --- a/commit-tree.c +++ b/commit-tree.c @@ -92,7 +92,7 @@ int main(int argc, char **argv) git_config(git_default_config); - if (argc < 2 || get_sha1_hex(argv[1], tree_sha1) < 0) + if (argc < 2 || get_sha1(argv[1], tree_sha1) < 0) usage(commit_tree_usage); check_valid(tree_sha1, tree_type);