diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 74af5d263ff..aa5ec02f2d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -232,6 +232,8 @@ jobs: - name: Make `system` scope nonempty for "GitInstallation" tests run: git config --system gitoxide.imaginary.arbitraryVariable arbitraryValue - name: Test (nextest) + env: + GIX_TEST_IGNORE_ARCHIVES: '1' run: cargo nextest run --workspace --no-fail-fast test-32bit-cross: diff --git a/gix-commitgraph/tests/fixtures/generated-archives/generation_number_overflow.tar b/gix-commitgraph/tests/fixtures/generated-archives/generation_number_overflow.tar index 396b512951c..13dfbb09248 100644 Binary files a/gix-commitgraph/tests/fixtures/generated-archives/generation_number_overflow.tar and b/gix-commitgraph/tests/fixtures/generated-archives/generation_number_overflow.tar differ diff --git a/gix-commitgraph/tests/fixtures/generation_number_overflow.sh b/gix-commitgraph/tests/fixtures/generation_number_overflow.sh index 1bbe2dfdf31..6da76f786d3 100755 --- a/gix-commitgraph/tests/fixtures/generation_number_overflow.sh +++ b/gix-commitgraph/tests/fixtures/generation_number_overflow.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -eu -o pipefail -function tick () { +function tick() { if test -z "${tick+set}" then tick=1112911993 @@ -13,9 +13,25 @@ function tick () { export GIT_COMMITTER_DATE GIT_AUTHOR_DATE } -tick -function commit() { - local message=${1:?first argument is the commit message} +function force_tag() { + local name head_oid common_dir + name=${1:?argument the tag name} + + # This should only be needed with 32-bit `git`, so fail otherwise. + word_size="$( + git --version --build-options | + awk '$1 == "sizeof-size_t:" { print $2 }' + )" + ((word_size == 4)) + + # Manually create the tag. + head_oid="$(git rev-parse HEAD)" + common_dir="$(git rev-parse --git-common-dir)" + (set -o noclobber; echo "$head_oid" > "$common_dir/refs/tags/$name") +} + +function tagged_commit() { + local message=${1:?first argument is the commit message and tag name} local date=${2:-} local file="$message.t" echo "$1" > "$file" @@ -26,9 +42,11 @@ function commit() { tick fi git commit -m "$message" - git tag "$message" + git tag -- "$message" || force_tag "$message" } +tick + # adapted from git/t/t5318 'lower layers have overflow chunk' UNIX_EPOCH_ZERO="@0 +0000" FUTURE_DATE="@4147483646 +0000" @@ -36,12 +54,12 @@ FUTURE_DATE="@4147483646 +0000" git init git config commitGraph.generationVersion 2 -commit future-1 "$FUTURE_DATE" -commit old-1 "$UNIX_EPOCH_ZERO" +tagged_commit future-1 "$FUTURE_DATE" +tagged_commit old-1 "$UNIX_EPOCH_ZERO" git commit-graph write --reachable -commit future-2 "$FUTURE_DATE" -commit old-2 "$UNIX_EPOCH_ZERO" +tagged_commit future-2 "$FUTURE_DATE" +tagged_commit old-2 "$UNIX_EPOCH_ZERO" git commit-graph write --reachable --split=no-merge -commit extra +tagged_commit extra # this makes sure it's actually in chain format. git commit-graph write --reachable --split=no-merge