summaryrefslogtreecommitdiff
path: root/t/t6501-freshen-objects.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t6501-freshen-objects.sh')
-rwxr-xr-xt/t6501-freshen-objects.sh41
1 files changed, 27 insertions, 14 deletions
diff --git a/t/t6501-freshen-objects.sh b/t/t6501-freshen-objects.sh
index f30b4849b6..10662456ae 100755
--- a/t/t6501-freshen-objects.sh
+++ b/t/t6501-freshen-objects.sh
@@ -25,6 +25,9 @@
# to refer to an existing tree).
test_description='check pruning of dependent objects'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
. ./test-lib.sh
# We care about reachability, so we do not want to use
@@ -40,15 +43,25 @@ commit () {
}
maybe_repack () {
- if test -n "$repack"; then
+ case "$title" in
+ loose)
+ : skip repack
+ ;;
+ repack)
git repack -ad
- fi
+ ;;
+ bitmap)
+ git repack -adb
+ ;;
+ *)
+ echo >&2 "unknown test type in maybe_repack"
+ return 1
+ ;;
+ esac
}
-for repack in '' true; do
- title=${repack:+repack}
- title=${title:-loose}
-
+for title in loose repack bitmap
+do
test_expect_success "make repo completely empty ($title)" '
rm -rf .git &&
git init
@@ -67,7 +80,7 @@ for repack in '' true; do
git checkout -b experiment &&
commit abandon &&
maybe_repack &&
- git checkout master &&
+ git checkout main &&
git branch -D experiment
'
@@ -128,9 +141,9 @@ for repack in '' true; do
done
test_expect_success 'do not complain about existing broken links (commit)' '
- cat >broken-commit <<-\EOF &&
- tree 0000000000000000000000000000000000000001
- parent 0000000000000000000000000000000000000002
+ cat >broken-commit <<-EOF &&
+ tree $(test_oid 001)
+ parent $(test_oid 002)
author whatever <whatever@example.com> 1234 -0000
committer whatever <whatever@example.com> 1234 -0000
@@ -143,8 +156,8 @@ test_expect_success 'do not complain about existing broken links (commit)' '
'
test_expect_success 'do not complain about existing broken links (tree)' '
- cat >broken-tree <<-\EOF &&
- 100644 blob 0000000000000000000000000000000000000003 foo
+ cat >broken-tree <<-EOF &&
+ 100644 blob $(test_oid 003) foo
EOF
tree=$(git mktree --missing <broken-tree) &&
git gc -q 2>stderr &&
@@ -153,8 +166,8 @@ test_expect_success 'do not complain about existing broken links (tree)' '
'
test_expect_success 'do not complain about existing broken links (tag)' '
- cat >broken-tag <<-\EOF &&
- object 0000000000000000000000000000000000000004
+ cat >broken-tag <<-EOF &&
+ object $(test_oid 004)
type commit
tag broken
tagger whatever <whatever@example.com> 1234 -0000