about summary refs log tree commit diff
path: root/third_party/git/t/t5308-pack-detect-duplicates.sh
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-09-21T10·03+0300
committerVincent Ambo <mail@tazj.in>2021-09-21T11·29+0300
commit43b1791ec601732ac31195df96781a848360a9ac (patch)
treedaae8d638343295d2f1f7da955e556ef4c958864 /third_party/git/t/t5308-pack-detect-duplicates.sh
parent2d8e7dc9d9c38127ec4ebd13aee8e8f586a43318 (diff)
chore(3p/git): Unvendor git and track patches instead r/2903
This was vendored a long time ago under the expectation that keeping
it in sync with cgit would be easier this way, but it has proven not
to be a big issue.

On the other hand, a vendored copy of git is an annoying maintenance
burden. It is much easier to rebase the single (dottime) patch that we
have.

This removes the vendored copy of git and instead passes the git
source code to cgit via `pkgs.srcOnly`, which includes the applied
patch so that cgit can continue rendering dottime.

Change-Id: If31f62dea7ce688fd1b9050204e9378019775f2b
Diffstat (limited to 'third_party/git/t/t5308-pack-detect-duplicates.sh')
-rwxr-xr-xthird_party/git/t/t5308-pack-detect-duplicates.sh81
1 files changed, 0 insertions, 81 deletions
diff --git a/third_party/git/t/t5308-pack-detect-duplicates.sh b/third_party/git/t/t5308-pack-detect-duplicates.sh
deleted file mode 100755
index 693b2411c899..000000000000
--- a/third_party/git/t/t5308-pack-detect-duplicates.sh
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/bin/sh
-
-test_description='handling of duplicate objects in incoming packfiles'
-. ./test-lib.sh
-. "$TEST_DIRECTORY"/lib-pack.sh
-
-test_expect_success 'setup' '
-	test_oid_cache <<-EOF
-	lo_oid sha1:e68fe8129b546b101aee9510c5328e7f21ca1d18
-	lo_oid sha256:471819e8c52bf11513f100b2810a8aa0622d5cd3d1c913758a071dd4b3bad8fe
-
-	missing_oid sha1:e69d000000000000000000000000000000000000
-	missing_oid sha256:4720000000000000000000000000000000000000000000000000000000000000
-	EOF
-'
-
-# The sha1s we have in our pack. It's important that these have the same
-# starting byte, so that they end up in the same fanout section of the index.
-# That lets us make sure we are exercising the binary search with both sets.
-LO_SHA1=$(test_oid lo_oid)
-HI_SHA1=$EMPTY_BLOB
-
-# And here's a "missing sha1" which will produce failed lookups. It must also
-# be in the same fanout section, and should be between the two (so that during
-# our binary search, we are sure to end up looking at one or the other of the
-# duplicate runs).
-MISSING_SHA1=$(test_oid missing_oid)
-
-# git will never intentionally create packfiles with
-# duplicate objects, so we have to construct them by hand.
-#
-# $1 is the name of the packfile to create
-#
-# $2 is the number of times to duplicate each object
-create_pack () {
-	pack_header "$((2 * $2))" >"$1" &&
-	for i in $(test_seq 1 "$2"); do
-		pack_obj $LO_SHA1 &&
-		pack_obj $HI_SHA1
-	done >>"$1" &&
-	pack_trailer "$1"
-}
-
-# double-check that create_pack actually works
-test_expect_success 'pack with no duplicates' '
-	create_pack no-dups.pack 1 &&
-	git index-pack --stdin <no-dups.pack
-'
-
-test_expect_success 'index-pack will allow duplicate objects by default' '
-	clear_packs &&
-	create_pack dups.pack 100 &&
-	git index-pack --stdin <dups.pack
-'
-
-test_expect_success 'create batch-check test vectors' '
-	cat >input <<-EOF &&
-	$LO_SHA1
-	$HI_SHA1
-	$MISSING_SHA1
-	EOF
-	cat >expect <<-EOF
-	$LO_SHA1 blob 2
-	$HI_SHA1 blob 0
-	$MISSING_SHA1 missing
-	EOF
-'
-
-test_expect_success 'lookup in duplicated pack' '
-	git cat-file --batch-check <input >actual &&
-	test_cmp expect actual
-'
-
-test_expect_success 'index-pack can reject packs with duplicates' '
-	clear_packs &&
-	create_pack dups.pack 2 &&
-	test_must_fail git index-pack --strict --stdin <dups.pack &&
-	test_expect_code 1 git cat-file -e $LO_SHA1
-'
-
-test_done