summaryrefslogtreecommitdiffstats
path: root/t/t5613-info-alternate.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2016-10-03 22:36:18 +0200
committerJunio C Hamano <gitster@pobox.com>2016-10-10 22:52:37 +0200
commit5fe849d651e259af58f29f9cfb1b1405154ffacc (patch)
tree2db0fc624b89d513744ffa04c7faa18009dd1d93 /t/t5613-info-alternate.sh
parentfill_sha1_file: write into a strbuf (diff)
downloadgit-5fe849d651e259af58f29f9cfb1b1405154ffacc.tar.xz
git-5fe849d651e259af58f29f9cfb1b1405154ffacc.zip
count-objects: report alternates via verbose mode
There's no way to get the list of alternates that git computes internally; our tests only infer it based on which objects are available. In addition to testing, knowing this list may be helpful for somebody debugging their alternates setup. Let's add it to the "count-objects -v" output. We could give it a separate flag, but there's not really any need. "count-objects -v" is already a debugging catch-all for the object database, its output is easily extensible to new data items, and printing the alternates is not expensive (we already had to find them to count the objects). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5613-info-alternate.sh')
-rwxr-xr-xt/t5613-info-alternate.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t5613-info-alternate.sh b/t/t5613-info-alternate.sh
index 62170b7659..e146a8def6 100755
--- a/t/t5613-info-alternate.sh
+++ b/t/t5613-info-alternate.sh
@@ -39,6 +39,16 @@ test_expect_success 'preparing third repository' '
)
'
+test_expect_success 'count-objects shows the alternates' '
+ cat >expect <<-EOF &&
+ alternate: $(pwd)/B/.git/objects
+ alternate: $(pwd)/A/.git/objects
+ EOF
+ git -C C count-objects -v >actual &&
+ grep ^alternate: actual >actual.alternates &&
+ test_cmp expect actual.alternates
+'
+
# Note: These tests depend on the hard-coded value of 5 as the maximum depth
# we will follow recursion. We start the depth at 0 and count links, not
# repositories. This means that in a chain like: