diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-01-25 14:19:19 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-01-25 14:19:19 -0800 |
commit | 8b48981987956d7cb10c5d7cddbf08d5837bc753 (patch) | |
tree | 0ff61198ba641413b4da841c5c76386850048b02 /t/t5510-fetch.sh | |
parent | Merge branch 'ab/mailmap' (diff) | |
parent | bundle: arguments can be read from stdin (diff) | |
download | tgif-8b48981987956d7cb10c5d7cddbf08d5837bc753.tar.xz |
Merge branch 'jx/bundle'
"git bundle" learns "--stdin" option to read its refs from the
standard input. Also, it now does not lose refs whey they point
at the same object.
* jx/bundle:
bundle: arguments can be read from stdin
bundle: lost objects when removing duplicate pendings
test: add helper functions for git-bundle
Diffstat (limited to 't/t5510-fetch.sh')
-rwxr-xr-x | t/t5510-fetch.sh | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index 8da907e770..42f5503004 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -9,22 +9,10 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh +. "$TEST_DIRECTORY"/test-bundle-functions.sh D=$(pwd) -test_bundle_object_count () { - git verify-pack -v "$1" >verify.out && - test "$2" = $(grep "^$OID_REGEX " verify.out | wc -l) -} - -convert_bundle_to_pack () { - while read x && test -n "$x" - do - :; - done - cat -} - test_expect_success setup ' echo >file original && git add file && @@ -483,9 +471,7 @@ test_expect_success 'unbundle 1' ' test_expect_success 'bundle 1 has only 3 files ' ' cd "$D" && - convert_bundle_to_pack <bundle1 >bundle.pack && - git index-pack bundle.pack && - test_bundle_object_count bundle.pack 3 + test_bundle_object_count bundle1 3 ' test_expect_success 'unbundle 2' ' @@ -500,9 +486,7 @@ test_expect_success 'bundle does not prerequisite objects' ' git add file2 && git commit -m add.file2 file2 && git bundle create bundle3 -1 HEAD && - convert_bundle_to_pack <bundle3 >bundle.pack && - git index-pack bundle.pack && - test_bundle_object_count bundle.pack 3 + test_bundle_object_count bundle3 3 ' test_expect_success 'bundle should be able to create a full history' ' @@ -1055,9 +1039,7 @@ test_expect_success 'all boundary commits are excluded' ' git merge otherside && ad=$(git log --no-walk --format=%ad HEAD) && git bundle create twoside-boundary.bdl main --since="$ad" && - convert_bundle_to_pack <twoside-boundary.bdl >twoside-boundary.pack && - pack=$(git index-pack --fix-thin --stdin <twoside-boundary.pack) && - test_bundle_object_count .git/objects/pack/pack-${pack##pack }.pack 3 + test_bundle_object_count --thin twoside-boundary.bdl 3 ' test_expect_success 'fetch --prune prints the remotes url' ' |