summaryrefslogtreecommitdiff
path: root/t/t9351-fast-export-anonymize.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t9351-fast-export-anonymize.sh')
-rwxr-xr-xt/t9351-fast-export-anonymize.sh17
1 files changed, 11 insertions, 6 deletions
diff --git a/t/t9351-fast-export-anonymize.sh b/t/t9351-fast-export-anonymize.sh
index 5ac2c3b5ee..77047e250d 100755
--- a/t/t9351-fast-export-anonymize.sh
+++ b/t/t9351-fast-export-anonymize.sh
@@ -1,6 +1,9 @@
#!/bin/sh
test_description='basic tests for fast-export --anonymize'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
. ./test-lib.sh
test_expect_success 'setup simple repo' '
@@ -15,7 +18,8 @@ test_expect_success 'setup simple repo' '
git update-index --add --cacheinfo 160000,$fake_commit,link1 &&
git update-index --add --cacheinfo 160000,$fake_commit,link2 &&
git commit -m "add gitlink" &&
- git tag -m "annotated tag" mytag
+ git tag -m "annotated tag" mytag &&
+ git tag -m "annotated tag with long message" longtag
'
test_expect_success 'export anonymized stream' '
@@ -51,8 +55,9 @@ test_expect_success 'stream retains other as refname' '
'
test_expect_success 'stream omits other refnames' '
- ! grep master stream &&
- ! grep mytag stream
+ ! grep main stream &&
+ ! grep mytag stream &&
+ ! grep longtag stream
'
test_expect_success 'stream omits identities' '
@@ -85,7 +90,7 @@ test_expect_success 'repo has original shape and timestamps' '
shape () {
git log --format="%m %ct" --left-right --boundary "$@"
} &&
- (cd .. && shape master...other) >expect &&
+ (cd .. && shape main...other) >expect &&
shape $main_branch...$other_branch >actual &&
test_cmp expect actual
'
@@ -115,9 +120,9 @@ test_expect_success 'identical gitlinks got identical oid' '
test_line_count = 1 commits
'
-test_expect_success 'tag points to branch tip' '
+test_expect_success 'all tags point to branch tip' '
git rev-parse $other_branch >expect &&
- git for-each-ref --format="%(*objectname)" | grep . >actual &&
+ git for-each-ref --format="%(*objectname)" | grep . | uniq >actual &&
test_cmp expect actual
'