diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-08-03 11:01:19 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-08-03 11:01:19 -0700 |
commit | d2c3464fefc394cc0b8f0db903b18dc1e9a38fdc (patch) | |
tree | 5d78483b5f096004b48a2ada7e58611bdeb603ff /t | |
parent | b2f44feba593ed0c4294a6f9933c8a1b6f190e04 (diff) | |
parent | 3115ee45c8c7c0b753663890b13ec0e14fe4c0d7 (diff) | |
download | git-d2c3464fefc394cc0b8f0db903b18dc1e9a38fdc.tar.gz |
Merge branch 'jk/cat-file-batch-all'
"cat-file" learned "--batch-all-objects" option to enumerate all
available objects in the repository more quickly than "rev-list
--all --objects" (the output includes unreachable objects, though).
* jk/cat-file-batch-all:
cat-file: sort and de-dup output of --batch-all-objects
cat-file: add --batch-all-objects option
cat-file: split batch_one_object into two stages
cat-file: stop returning value from batch_one_object
cat-file: add --buffer option
cat-file: move batch_options definition to top of file
cat-file: minor style fix in options list
Diffstat (limited to 't')
-rwxr-xr-x | t/t1006-cat-file.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh index 93a4794930..4f38078ff3 100755 --- a/t/t1006-cat-file.sh +++ b/t/t1006-cat-file.sh @@ -547,4 +547,30 @@ test_expect_success 'git cat-file --batch --follow-symlink returns correct sha a test_cmp expect actual ' +test_expect_success 'cat-file --batch-all-objects shows all objects' ' + # make new repos so we know the full set of objects; we will + # also make sure that there are some packed and some loose + # objects, some referenced and some not, and that there are + # some available only via alternates. + git init all-one && + ( + cd all-one && + echo content >file && + git add file && + git commit -qm base && + git rev-parse HEAD HEAD^{tree} HEAD:file && + git repack -ad && + echo not-cloned | git hash-object -w --stdin + ) >expect.unsorted && + git clone -s all-one all-two && + ( + cd all-two && + echo local-unref | git hash-object -w --stdin + ) >>expect.unsorted && + sort <expect.unsorted >expect && + git -C all-two cat-file --batch-all-objects \ + --batch-check="%(objectname)" >actual && + test_cmp expect actual +' + test_done |