summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/Makefile7
-rw-r--r--t/README48
-rw-r--r--t/annotate-tests.sh18
-rw-r--r--t/helper/test-crontab.c35
-rw-r--r--t/helper/test-fast-rebase.c211
-rw-r--r--t/helper/test-pkt-line.c23
-rw-r--r--t/helper/test-tool.c2
-rw-r--r--t/helper/test-tool.h2
-rw-r--r--t/lib-merge.sh13
-rw-r--r--t/lib-submodule-update.sh2
-rw-r--r--t/perf/Makefile5
-rw-r--r--t/perf/README2
-rwxr-xr-xt/perf/p3400-rebase.sh6
-rwxr-xr-xt/perf/p7519-fsmonitor.sh156
-rwxr-xr-xt/t0000-basic.sh55
-rwxr-xr-xt/t0001-init.sh13
-rwxr-xr-xt/t0021-conversion.sh36
-rwxr-xr-xt/t0068-for-each-repo.sh30
-rwxr-xr-xt/t0070-fundamental.sh18
-rwxr-xr-xt/t0300-credentials.sh26
-rwxr-xr-xt/t1004-read-tree-m-u-wf.sh2
-rwxr-xr-xt/t1050-large.sh8
-rwxr-xr-xt/t1400-update-ref.sh10
-rwxr-xr-xt/t2004-checkout-cache-temp.sh10
-rwxr-xr-xt/t2006-checkout-index-basic.sh11
-rwxr-xr-xt/t2016-checkout-patch.sh11
-rwxr-xr-xt/t2024-checkout-dwim.sh11
-rwxr-xr-xt/t2060-switch.sh5
-rwxr-xr-xt/t2071-restore-patch.sh8
-rwxr-xr-xt/t2200-add-update.sh3
-rwxr-xr-xt/t2402-worktree-list.sh10
-rwxr-xr-xt/t3200-branch.sh16
-rwxr-xr-xt/t3201-branch-contains.sh8
-rwxr-xr-xt/t3203-branch-output.sh4
-rwxr-xr-xt/t3205-branch-color.sh8
-rwxr-xr-xt/t3404-rebase-interactive.sh11
-rwxr-xr-xt/t3406-rebase-message.sh16
-rwxr-xr-xt/t3427-rebase-subtree.sh2
-rwxr-xr-xt/t3435-rebase-gpg-sign.sh56
-rwxr-xr-xt/t3920-crlf-messages.sh126
-rwxr-xr-xt/t4013-diff-various.sh41
-rw-r--r--t/t4013/diff.log_-IA_-IB_-I1_-I2_-p_master99
-rwxr-xr-xt/t4014-format-patch.sh33
-rwxr-xr-xt/t4018-diff-funcname.sh1
-rw-r--r--t/t4018/bash-arithmetic-function4
-rw-r--r--t/t4018/bash-bashism-style-compact6
-rw-r--r--t/t4018/bash-bashism-style-function4
-rw-r--r--t/t4018/bash-bashism-style-whitespace4
-rw-r--r--t/t4018/bash-conditional-function4
-rw-r--r--t/t4018/bash-missing-parentheses6
-rw-r--r--t/t4018/bash-mixed-style-compact4
-rw-r--r--t/t4018/bash-mixed-style-function4
-rw-r--r--t/t4018/bash-nested-functions6
-rw-r--r--t/t4018/bash-other-characters4
-rw-r--r--t/t4018/bash-posix-style-compact4
-rw-r--r--t/t4018/bash-posix-style-function4
-rw-r--r--t/t4018/bash-posix-style-whitespace4
-rw-r--r--t/t4018/bash-subshell-function4
-rw-r--r--t/t4018/bash-trailing-comment4
-rw-r--r--t/t4018/css-attribute-value-selector4
-rw-r--r--t/t4018/css-block-level-@-statements10
-rw-r--r--t/t4018/css-class-selector4
-rw-r--r--t/t4018/css-id-selector4
-rw-r--r--t/t4018/css-root-selector4
-rw-r--r--t/t4018/php-abstract-method7
-rw-r--r--t/t4018/php-final-method7
-rw-r--r--t/t4018/rust-macro-rules6
-rwxr-xr-xt/t4068-diff-symmetric-merge-base.sh193
-rwxr-xr-xt/t4068-diff-symmetric.sh91
-rwxr-xr-xt/t4114-apply-typechange.sh7
-rwxr-xr-xt/t4127-apply-same-fn.sh9
-rwxr-xr-xt/t4211-line-log.sh22
-rwxr-xr-xt/t5315-pack-objects-compression.sh8
-rwxr-xr-xt/t5319-multi-pack-index.sh15
-rwxr-xr-xt/t5324-split-commit-graph.sh13
-rwxr-xr-xt/t5400-send-pack.sh153
-rwxr-xr-xt/t5402-post-merge-hook.sh16
-rwxr-xr-xt/t5411-proc-receive-hook.sh17
-rw-r--r--t/t5411/common-functions.sh2
-rw-r--r--t/t5411/once-0010-report-status-v1.sh50
-rw-r--r--t/t5411/test-0000-standard-git-push.sh72
-rw-r--r--t/t5411/test-0001-standard-git-push--porcelain.sh72
-rw-r--r--t/t5411/test-0002-pre-receive-declined.sh12
-rw-r--r--t/t5411/test-0003-pre-receive-declined--porcelain.sh12
-rw-r--r--t/t5411/test-0011-no-hook-error.sh38
-rw-r--r--t/t5411/test-0012-no-hook-error--porcelain.sh38
-rw-r--r--t/t5411/test-0013-bad-protocol.sh96
-rw-r--r--t/t5411/test-0014-bad-protocol--porcelain.sh70
-rw-r--r--t/t5411/test-0020-report-ng.sh40
-rw-r--r--t/t5411/test-0021-report-ng--porcelain.sh40
-rw-r--r--t/t5411/test-0022-report-unexpect-ref.sh36
-rw-r--r--t/t5411/test-0023-report-unexpect-ref--porcelain.sh36
-rw-r--r--t/t5411/test-0024-report-unknown-ref.sh12
-rw-r--r--t/t5411/test-0025-report-unknown-ref--porcelain.sh12
-rw-r--r--t/t5411/test-0026-push-options.sh36
-rw-r--r--t/t5411/test-0027-push-options--porcelain.sh36
-rw-r--r--t/t5411/test-0030-report-ok.sh22
-rw-r--r--t/t5411/test-0031-report-ok--porcelain.sh22
-rw-r--r--t/t5411/test-0032-report-with-options.sh120
-rw-r--r--t/t5411/test-0033-report-with-options--porcelain.sh120
-rw-r--r--t/t5411/test-0034-report-ft.sh30
-rw-r--r--t/t5411/test-0035-report-ft--porcelain.sh30
-rw-r--r--t/t5411/test-0036-report-multi-rewrite-for-one-ref.sh90
-rw-r--r--t/t5411/test-0037-report-multi-rewrite-for-one-ref--porcelain.sh82
-rw-r--r--t/t5411/test-0038-report-mixed-refs.sh40
-rw-r--r--t/t5411/test-0039-report-mixed-refs--porcelain.sh40
-rw-r--r--t/t5411/test-0040-process-all-refs.sh42
-rw-r--r--t/t5411/test-0041-process-all-refs--porcelain.sh42
-rw-r--r--t/t5411/test-0050-proc-receive-refs-with-modifiers.sh42
-rwxr-xr-xt/t5505-remote.sh59
-rwxr-xr-xt/t5510-fetch.sh8
-rwxr-xr-xt/t5515-fetch-merge-logic.sh27
-rw-r--r--t/t5515/fetch.br-branches-default4
-rw-r--r--t/t5515/fetch.br-branches-default-merge4
-rw-r--r--t/t5515/fetch.br-branches-default-merge_branches-default4
-rw-r--r--t/t5515/fetch.br-branches-default-octopus4
-rw-r--r--t/t5515/fetch.br-branches-default-octopus_branches-default4
-rw-r--r--t/t5515/fetch.br-branches-default_branches-default4
-rw-r--r--t/t5515/fetch.br-branches-one2
-rw-r--r--t/t5515/fetch.br-branches-one-merge2
-rw-r--r--t/t5515/fetch.br-branches-one-merge_branches-one2
-rw-r--r--t/t5515/fetch.br-branches-one-octopus2
-rw-r--r--t/t5515/fetch.br-branches-one-octopus_branches-one2
-rw-r--r--t/t5515/fetch.br-branches-one_branches-one2
-rw-r--r--t/t5515/fetch.br-config-explicit4
-rw-r--r--t/t5515/fetch.br-config-explicit-merge4
-rw-r--r--t/t5515/fetch.br-config-explicit-merge_config-explicit4
-rw-r--r--t/t5515/fetch.br-config-explicit-octopus4
-rw-r--r--t/t5515/fetch.br-config-explicit-octopus_config-explicit4
-rw-r--r--t/t5515/fetch.br-config-explicit_config-explicit4
-rw-r--r--t/t5515/fetch.br-config-glob4
-rw-r--r--t/t5515/fetch.br-config-glob-merge4
-rw-r--r--t/t5515/fetch.br-config-glob-merge_config-glob4
-rw-r--r--t/t5515/fetch.br-config-glob-octopus4
-rw-r--r--t/t5515/fetch.br-config-glob-octopus_config-glob4
-rw-r--r--t/t5515/fetch.br-config-glob_config-glob4
-rw-r--r--t/t5515/fetch.br-remote-explicit4
-rw-r--r--t/t5515/fetch.br-remote-explicit-merge4
-rw-r--r--t/t5515/fetch.br-remote-explicit-merge_remote-explicit4
-rw-r--r--t/t5515/fetch.br-remote-explicit-octopus4
-rw-r--r--t/t5515/fetch.br-remote-explicit-octopus_remote-explicit4
-rw-r--r--t/t5515/fetch.br-remote-explicit_remote-explicit4
-rw-r--r--t/t5515/fetch.br-remote-glob4
-rw-r--r--t/t5515/fetch.br-remote-glob-merge4
-rw-r--r--t/t5515/fetch.br-remote-glob-merge_remote-glob4
-rw-r--r--t/t5515/fetch.br-remote-glob-octopus4
-rw-r--r--t/t5515/fetch.br-remote-glob-octopus_remote-glob4
-rw-r--r--t/t5515/fetch.br-remote-glob_remote-glob4
-rw-r--r--t/t5515/fetch.br-unconfig4
-rw-r--r--t/t5515/fetch.br-unconfig_--tags_.._.git2
-rw-r--r--t/t5515/fetch.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file2
-rw-r--r--t/t5515/fetch.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file2
-rw-r--r--t/t5515/fetch.br-unconfig_.._.git_tag_tag-one_tag_tag-three2
-rw-r--r--t/t5515/fetch.br-unconfig_branches-default4
-rw-r--r--t/t5515/fetch.br-unconfig_branches-one2
-rw-r--r--t/t5515/fetch.br-unconfig_config-explicit4
-rw-r--r--t/t5515/fetch.br-unconfig_config-glob4
-rw-r--r--t/t5515/fetch.br-unconfig_remote-explicit4
-rw-r--r--t/t5515/fetch.br-unconfig_remote-glob4
-rw-r--r--t/t5515/fetch.main (renamed from t/t5515/fetch.master)6
-rw-r--r--t/t5515/fetch.main_--tags_.._.git (renamed from t/t5515/fetch.master_--tags_.._.git)4
-rw-r--r--t/t5515/fetch.main_.._.git (renamed from t/t5515/fetch.master_.._.git)2
-rw-r--r--t/t5515/fetch.main_.._.git_one (renamed from t/t5515/fetch.master_.._.git_one)2
-rw-r--r--t/t5515/fetch.main_.._.git_one_tag_tag-one_tag_tag-three-file (renamed from t/t5515/fetch.master_.._.git_one_tag_tag-one_tag_tag-three-file)4
-rw-r--r--t/t5515/fetch.main_.._.git_one_two (renamed from t/t5515/fetch.master_.._.git_one_two)2
-rw-r--r--t/t5515/fetch.main_.._.git_tag_tag-one-tree_tag_tag-three-file (renamed from t/t5515/fetch.master_.._.git_tag_tag-one-tree_tag_tag-three-file)4
-rw-r--r--t/t5515/fetch.main_.._.git_tag_tag-one_tag_tag-three (renamed from t/t5515/fetch.master_.._.git_tag_tag-one_tag_tag-three)4
-rw-r--r--t/t5515/fetch.main_branches-default (renamed from t/t5515/fetch.master_branches-default)6
-rw-r--r--t/t5515/fetch.main_branches-one (renamed from t/t5515/fetch.master_branches-one)4
-rw-r--r--t/t5515/fetch.main_config-explicit (renamed from t/t5515/fetch.master_config-explicit)6
-rw-r--r--t/t5515/fetch.main_config-glob (renamed from t/t5515/fetch.master_config-glob)6
-rw-r--r--t/t5515/fetch.main_remote-explicit (renamed from t/t5515/fetch.master_remote-explicit)6
-rw-r--r--t/t5515/fetch.main_remote-glob11
-rw-r--r--t/t5515/fetch.master_remote-glob11
-rw-r--r--t/t5515/refs.br-branches-default6
-rw-r--r--t/t5515/refs.br-branches-default-merge6
-rw-r--r--t/t5515/refs.br-branches-default-merge_branches-default6
-rw-r--r--t/t5515/refs.br-branches-default-octopus6
-rw-r--r--t/t5515/refs.br-branches-default-octopus_branches-default6
-rw-r--r--t/t5515/refs.br-branches-default_branches-default6
-rw-r--r--t/t5515/refs.br-branches-one4
-rw-r--r--t/t5515/refs.br-branches-one-merge4
-rw-r--r--t/t5515/refs.br-branches-one-merge_branches-one4
-rw-r--r--t/t5515/refs.br-branches-one-octopus4
-rw-r--r--t/t5515/refs.br-branches-one-octopus_branches-one4
-rw-r--r--t/t5515/refs.br-branches-one_branches-one4
-rw-r--r--t/t5515/refs.br-config-explicit6
-rw-r--r--t/t5515/refs.br-config-explicit-merge6
-rw-r--r--t/t5515/refs.br-config-explicit-merge_config-explicit6
-rw-r--r--t/t5515/refs.br-config-explicit-octopus6
-rw-r--r--t/t5515/refs.br-config-explicit-octopus_config-explicit6
-rw-r--r--t/t5515/refs.br-config-explicit_config-explicit6
-rw-r--r--t/t5515/refs.br-config-glob6
-rw-r--r--t/t5515/refs.br-config-glob-merge6
-rw-r--r--t/t5515/refs.br-config-glob-merge_config-glob6
-rw-r--r--t/t5515/refs.br-config-glob-octopus6
-rw-r--r--t/t5515/refs.br-config-glob-octopus_config-glob6
-rw-r--r--t/t5515/refs.br-config-glob_config-glob6
-rw-r--r--t/t5515/refs.br-remote-explicit6
-rw-r--r--t/t5515/refs.br-remote-explicit-merge6
-rw-r--r--t/t5515/refs.br-remote-explicit-merge_remote-explicit6
-rw-r--r--t/t5515/refs.br-remote-explicit-octopus6
-rw-r--r--t/t5515/refs.br-remote-explicit-octopus_remote-explicit6
-rw-r--r--t/t5515/refs.br-remote-explicit_remote-explicit6
-rw-r--r--t/t5515/refs.br-remote-glob6
-rw-r--r--t/t5515/refs.br-remote-glob-merge6
-rw-r--r--t/t5515/refs.br-remote-glob-merge_remote-glob6
-rw-r--r--t/t5515/refs.br-remote-glob-octopus6
-rw-r--r--t/t5515/refs.br-remote-glob-octopus_remote-glob6
-rw-r--r--t/t5515/refs.br-remote-glob_remote-glob6
-rw-r--r--t/t5515/refs.br-unconfig4
-rw-r--r--t/t5515/refs.br-unconfig_--tags_.._.git4
-rw-r--r--t/t5515/refs.br-unconfig_.._.git2
-rw-r--r--t/t5515/refs.br-unconfig_.._.git_one2
-rw-r--r--t/t5515/refs.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file4
-rw-r--r--t/t5515/refs.br-unconfig_.._.git_one_two2
-rw-r--r--t/t5515/refs.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file4
-rw-r--r--t/t5515/refs.br-unconfig_.._.git_tag_tag-one_tag_tag-three4
-rw-r--r--t/t5515/refs.br-unconfig_branches-default6
-rw-r--r--t/t5515/refs.br-unconfig_branches-one4
-rw-r--r--t/t5515/refs.br-unconfig_config-explicit6
-rw-r--r--t/t5515/refs.br-unconfig_config-glob6
-rw-r--r--t/t5515/refs.br-unconfig_remote-explicit6
-rw-r--r--t/t5515/refs.br-unconfig_remote-glob6
-rw-r--r--t/t5515/refs.main (renamed from t/t5515/refs.master_.._.git_one_tag_tag-one_tag_tag-three-file)4
-rw-r--r--t/t5515/refs.main_--tags_.._.git (renamed from t/t5515/refs.master_.._.git_tag_tag-one-tree_tag_tag-three-file)4
-rw-r--r--t/t5515/refs.main_.._.git (renamed from t/t5515/refs.master_.._.git_one_two)2
-rw-r--r--t/t5515/refs.main_.._.git_one (renamed from t/t5515/refs.master_.._.git)2
-rw-r--r--t/t5515/refs.main_.._.git_one_tag_tag-one_tag_tag-three-file (renamed from t/t5515/refs.master)4
-rw-r--r--t/t5515/refs.main_.._.git_one_two (renamed from t/t5515/refs.master_.._.git_one)2
-rw-r--r--t/t5515/refs.main_.._.git_tag_tag-one-tree_tag_tag-three-file (renamed from t/t5515/refs.master_--tags_.._.git)4
-rw-r--r--t/t5515/refs.main_.._.git_tag_tag-one_tag_tag-three11
-rw-r--r--t/t5515/refs.main_branches-default (renamed from t/t5515/refs.master_branches-default)6
-rw-r--r--t/t5515/refs.main_branches-one (renamed from t/t5515/refs.master_branches-one)4
-rw-r--r--t/t5515/refs.main_config-explicit (renamed from t/t5515/refs.master_config-explicit)6
-rw-r--r--t/t5515/refs.main_config-glob (renamed from t/t5515/refs.master_config-glob)6
-rw-r--r--t/t5515/refs.main_remote-explicit (renamed from t/t5515/refs.master_remote-explicit)6
-rw-r--r--t/t5515/refs.main_remote-glob (renamed from t/t5515/refs.master_remote-glob)6
-rw-r--r--t/t5515/refs.master_.._.git_tag_tag-one_tag_tag-three11
-rwxr-xr-xt/t5526-fetch-submodules.sh70
-rwxr-xr-xt/t5530-upload-pack-error.sh17
-rwxr-xr-xt/t5533-push-cas.sh137
-rwxr-xr-xt/t5570-git-daemon.sh12
-rwxr-xr-xt/t5606-clone-options.sh71
-rwxr-xr-xt/t5703-upload-pack-ref-in-want.sh6
-rwxr-xr-xt/t6006-rev-list-format.sh2
-rwxr-xr-xt/t6012-rev-list-simplify.sh2
-rwxr-xr-xt/t6200-fmt-merge-msg.sh2
-rwxr-xr-xt/t6302-for-each-ref-filter.sh24
-rwxr-xr-xt/t6400-merge-df.sh14
-rwxr-xr-xt/t6402-merge-rename.sh122
-rwxr-xr-xt/t6404-recursive-merge.sh14
-rwxr-xr-xt/t6416-recursive-corner-cases.sh200
-rwxr-xr-xt/t6422-merge-rename-corner-cases.sh37
-rwxr-xr-xt/t6423-merge-rename-directories.sh1242
-rwxr-xr-xt/t6426-merge-skip-unneeded-updates.sh3
-rwxr-xr-xt/t6430-merge-recursive.sh3
-rwxr-xr-xt/t6436-merge-overwrite.sh18
-rwxr-xr-xt/t6437-submodule-merge.sh25
-rwxr-xr-xt/t7006-pager.sh84
-rwxr-xr-xt/t7101-reset-empty-subdirs.sh66
-rwxr-xr-xt/t7102-reset.sh307
-rwxr-xr-xt/t7201-co.sh102
-rwxr-xr-xt/t7518-ident-corner-cases.sh2
-rwxr-xr-xt/t7602-merge-octopus-many.sh6
-rwxr-xr-xt/t7610-mergetool.sh32
-rwxr-xr-xt/t7900-maintenance.sh381
-rwxr-xr-xt/t9303-fast-import-compression.sh10
-rwxr-xr-xt/t9304-fast-import-marks.sh51
-rwxr-xr-xt/t9603-cvsimport-patchsets.sh24
-rwxr-xr-xt/t9801-git-p4-branch.sh12
-rwxr-xr-xt/t9832-unshelve.sh3
-rwxr-xr-xt/t9902-completion.sh60
-rw-r--r--t/test-lib-functions.sh20
-rw-r--r--t/test-lib.sh41
275 files changed, 4974 insertions, 2234 deletions
diff --git a/t/Makefile b/t/Makefile
index c83fd18..882d26e 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -34,6 +34,7 @@ CHAINLINTTMP_SQ = $(subst ','\'',$(CHAINLINTTMP))
T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
TGITWEB = $(sort $(wildcard t95[0-9][0-9]-*.sh))
THELPERS = $(sort $(filter-out $(T),$(wildcard *.sh)))
+TPERF = $(sort $(wildcard perf/p[0-9][0-9][0-9][0-9]-*.sh))
CHAINLINTTESTS = $(sort $(patsubst chainlint/%.test,%,$(wildcard chainlint/*.test)))
CHAINLINT = sed -f chainlint.sed
@@ -81,17 +82,17 @@ test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax \
test-lint-filenames
test-lint-duplicates:
- @dups=`echo $(T) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \
+ @dups=`echo $(T) $(TPERF) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \
test -z "$$dups" || { \
echo >&2 "duplicate test numbers:" $$dups; exit 1; }
test-lint-executable:
- @bad=`for i in $(T); do test -x "$$i" || echo $$i; done` && \
+ @bad=`for i in $(T) $(TPERF); do test -x "$$i" || echo $$i; done` && \
test -z "$$bad" || { \
echo >&2 "non-executable tests:" $$bad; exit 1; }
test-lint-shell-syntax:
- @'$(PERL_PATH_SQ)' check-non-portable-shell.pl $(T) $(THELPERS)
+ @'$(PERL_PATH_SQ)' check-non-portable-shell.pl $(T) $(THELPERS) $(TPERF)
test-lint-filenames:
@# We do *not* pass a glob to ls-files but use grep instead, to catch
diff --git a/t/README b/t/README
index 2adaf7c..c730a70 100644
--- a/t/README
+++ b/t/README
@@ -258,16 +258,21 @@ For an individual test suite --run could be used to specify that
only some tests should be run or that some tests should be
excluded from a run.
-The argument for --run is a list of individual test numbers or
-ranges with an optional negation prefix that define what tests in
-a test suite to include in the run. A range is two numbers
-separated with a dash and matches a range of tests with both ends
-been included. You may omit the first or the second number to
-mean "from the first test" or "up to the very last test"
-respectively.
-
-Optional prefix of '!' means that the test or a range of tests
-should be excluded from the run.
+The argument for --run, <test-selector>, is a list of description
+substrings or globs or individual test numbers or ranges with an
+optional negation prefix (of '!') that define what tests in a test
+suite to include (or exclude, if negated) in the run. A range is two
+numbers separated with a dash and matches a range of tests with both
+ends been included. You may omit the first or the second number to
+mean "from the first test" or "up to the very last test" respectively.
+
+The argument to --run is split on commas into separate strings,
+numbers, and ranges, and picks all tests that match any of the
+individual selection criteria. If the substring of the description
+text that you want to match includes a comma, use the glob character
+'?' instead. For example --run='rebase,merge?cherry-pick' would match
+on all tests that match either the glob *rebase* or the glob
+*merge?cherry-pick*.
If --run starts with an unprefixed number or range the initial
set of tests to run is empty. If the first item starts with '!'
@@ -275,9 +280,6 @@ all the tests are added to the initial set. After initial set is
determined every test number or range is added or excluded from
the set one by one, from left to right.
-Individual numbers or ranges could be separated either by a space
-or a comma.
-
For example, to run only tests up to a specific test (21), one
could do this:
@@ -290,7 +292,7 @@ or this:
Common case is to run several setup tests (1, 2, 3) and then a
specific test (21) that relies on that setup:
- $ sh ./t9200-git-cvsexport-commit.sh --run='1 2 3 21'
+ $ sh ./t9200-git-cvsexport-commit.sh --run='1,2,3,21'
or:
@@ -298,17 +300,17 @@ or:
or:
- $ sh ./t9200-git-cvsexport-commit.sh --run='-3 21'
+ $ sh ./t9200-git-cvsexport-commit.sh --run='-3,21'
As noted above, the test set is built by going through the items
from left to right, so this:
- $ sh ./t9200-git-cvsexport-commit.sh --run='1-4 !3'
+ $ sh ./t9200-git-cvsexport-commit.sh --run='1-4,!3'
will run tests 1, 2, and 4. Items that come later have higher
precedence. It means that this:
- $ sh ./t9200-git-cvsexport-commit.sh --run='!3 1-4'
+ $ sh ./t9200-git-cvsexport-commit.sh --run='!3,1-4'
would just run tests from 1 to 4, including 3.
@@ -317,6 +319,18 @@ test in the test suite except from 7 up to 11:
$ sh ./t9200-git-cvsexport-commit.sh --run='!7-11'
+Sometimes there may be multiple tests with e.g. "setup" in their name
+that are needed and rather than figuring out the number for all of them
+we can just use "setup" as a substring/glob to match against the test
+description:
+
+ $ sh ./t0050-filesystem.sh --run=setup,9-11
+
+or one could select both the setup tests and the rename ones (assuming all
+relevant tests had those words in their descriptions):
+
+ $ sh ./t0050-filesystem.sh --run=setup,rename
+
Some tests in a test suite rely on the previous tests performing
certain actions, specifically some tests are designated as
"setup" test, so you cannot _arbitrarily_ disable one test and
diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh
index d933af5..3aee61d 100644
--- a/t/annotate-tests.sh
+++ b/t/annotate-tests.sh
@@ -479,6 +479,24 @@ test_expect_success 'blame -L ^:RE (absolute: end-of-file)' '
check_count -f hello.c -L$n -L^:ma.. F 4 G 1 H 1
'
+test_expect_success 'setup -L :funcname with userdiff driver' '
+ echo "fortran-* diff=fortran" >.gitattributes &&
+ fortran_file=fortran-external-function &&
+ orig_file="$TEST_DIRECTORY/t4018/$fortran_file" &&
+ cp $orig_file . &&
+ git add $fortran_file &&
+ GIT_AUTHOR_NAME="A" GIT_AUTHOR_EMAIL="A@test.git" \
+ git commit -m "add fortran file" &&
+ sed -e "s/ChangeMe/IWasChanged/" <"$orig_file" >$fortran_file &&
+ git add $fortran_file &&
+ GIT_AUTHOR_NAME="B" GIT_AUTHOR_EMAIL="B@test.git" \
+ git commit -m "change fortran file"
+'
+
+test_expect_success 'blame -L :funcname with userdiff driver' '
+ check_count -f fortran-external-function -L:RIGHT A 7 B 1
+'
+
test_expect_success 'setup incremental' '
(
GIT_AUTHOR_NAME=I &&
diff --git a/t/helper/test-crontab.c b/t/helper/test-crontab.c
new file mode 100644
index 0000000..e7c0137
--- /dev/null
+++ b/t/helper/test-crontab.c
@@ -0,0 +1,35 @@
+#include "test-tool.h"
+#include "cache.h"
+
+/*
+ * Usage: test-tool cron <file> [-l]
+ *
+ * If -l is specified, then write the contents of <file> to stdout.
+ * Otherwise, write from stdin into <file>.
+ */
+int cmd__crontab(int argc, const char **argv)
+{
+ int a;
+ FILE *from, *to;
+
+ if (argc == 3 && !strcmp(argv[2], "-l")) {
+ from = fopen(argv[1], "r");
+ if (!from)
+ return 0;
+ to = stdout;
+ } else if (argc == 2) {
+ from = stdin;
+ to = fopen(argv[1], "w");
+ } else
+ return error("unknown arguments");
+
+ while ((a = fgetc(from)) != EOF)
+ fputc(a, to);
+
+ if (argc == 3)
+ fclose(from);
+ else
+ fclose(to);
+
+ return 0;
+}
diff --git a/t/helper/test-fast-rebase.c b/t/helper/test-fast-rebase.c
new file mode 100644
index 0000000..3732122
--- /dev/null
+++ b/t/helper/test-fast-rebase.c
@@ -0,0 +1,211 @@
+/*
+ * "git fast-rebase" builtin command
+ *
+ * FAST: Forking Any Subprocesses (is) Taboo
+ *
+ * This is meant SOLELY as a demo of what is possible. sequencer.c and
+ * rebase.c should be refactored to use the ideas here, rather than attempting
+ * to extend this file to replace those (unless Phillip or Dscho say that
+ * refactoring is too hard and we need a clean slate, but I'm guessing that
+ * refactoring is the better route).
+ */
+
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
+#include "test-tool.h"
+
+#include "cache-tree.h"
+#include "commit.h"
+#include "lockfile.h"
+#include "merge-ort.h"
+#include "refs.h"
+#include "revision.h"
+#include "sequencer.h"
+#include "strvec.h"
+#include "tree.h"
+
+static const char *short_commit_name(struct commit *commit)
+{
+ return find_unique_abbrev(&commit->object.oid, DEFAULT_ABBREV);
+}
+
+static struct commit *peel_committish(const char *name)
+{
+ struct object *obj;
+ struct object_id oid;
+
+ if (get_oid(name, &oid))
+ return NULL;
+ obj = parse_object(the_repository, &oid);
+ return (struct commit *)peel_to_type(name, 0, obj, OBJ_COMMIT);
+}
+
+static char *get_author(const char *message)
+{
+ size_t len;
+ const char *a;
+
+ a = find_commit_header(message, "author", &len);
+ if (a)
+ return xmemdupz(a, len);
+
+ return NULL;
+}
+
+static struct commit *create_commit(struct tree *tree,
+ struct commit *based_on,
+ struct commit *parent)
+{
+ struct object_id ret;
+ struct object *obj;
+ struct commit_list *parents = NULL;
+ char *author;
+ char *sign_commit = NULL;
+ struct commit_extra_header *extra;
+ struct strbuf msg = STRBUF_INIT;
+ const char *out_enc = get_commit_output_encoding();
+ const char *message = logmsg_reencode(based_on, NULL, out_enc);
+ const char *orig_message = NULL;
+ const char *exclude_gpgsig[] = { "gpgsig", NULL };
+
+ commit_list_insert(parent, &parents);
+ extra = read_commit_extra_headers(based_on, exclude_gpgsig);
+ find_commit_subject(message, &orig_message);
+ strbuf_addstr(&msg, orig_message);
+ author = get_author(message);
+ reset_ident_date();
+ if (commit_tree_extended(msg.buf, msg.len, &tree->object.oid, parents,
+ &ret, author, NULL, sign_commit, extra)) {
+ error(_("failed to write commit object"));
+ return NULL;
+ }
+ free(author);
+ strbuf_release(&msg);
+
+ obj = parse_object(the_repository, &ret);
+ return (struct commit *)obj;
+}
+
+int cmd__fast_rebase(int argc, const char **argv)
+{
+ struct commit *onto;
+ struct commit *last_commit = NULL, *last_picked_commit = NULL;
+ struct object_id head;
+ struct lock_file lock = LOCK_INIT;
+ int clean = 1;
+ struct strvec rev_walk_args = STRVEC_INIT;
+ struct rev_info revs;
+ struct commit *commit;
+ struct merge_options merge_opt;
+ struct tree *next_tree, *base_tree, *head_tree;
+ struct merge_result result;
+ struct strbuf reflog_msg = STRBUF_INIT;
+ struct strbuf branch_name = STRBUF_INIT;
+
+ /*
+ * test-tool stuff doesn't set up the git directory by default; need to
+ * do that manually.
+ */
+ setup_git_directory();
+
+ if (argc == 2 && !strcmp(argv[1], "-h")) {
+ printf("Sorry, I am not a psychiatrist; I can not give you the help you need. Oh, you meant usage...\n");
+ exit(129);
+ }
+
+ if (argc != 5 || strcmp(argv[1], "--onto"))
+ die("usage: read the code, figure out how to use it, then do so");
+
+ onto = peel_committish(argv[2]);
+ strbuf_addf(&branch_name, "refs/heads/%s", argv[4]);
+
+ /* Sanity check */
+ if (get_oid("HEAD", &head))
+ die(_("Cannot read HEAD"));
+ assert(oideq(&onto->object.oid, &head));
+
+ hold_locked_index(&lock, LOCK_DIE_ON_ERROR);
+ assert(repo_read_index(the_repository) >= 0);
+
+ repo_init_revisions(the_repository, &revs, NULL);
+ revs.verbose_header = 1;
+ revs.max_parents = 1;
+ revs.cherry_mark = 1;
+ revs.limited = 1;
+ revs.reverse = 1;
+ revs.right_only = 1;
+ revs.sort_order = REV_SORT_IN_GRAPH_ORDER;
+ revs.topo_order = 1;
+ strvec_pushl(&rev_walk_args, "", argv[4], "--not", argv[3], NULL);
+
+ if (setup_revisions(rev_walk_args.nr, rev_walk_args.v, &revs, NULL) > 1)
+ return error(_("unhandled options"));
+
+ strvec_clear(&rev_walk_args);
+
+ if (prepare_revision_walk(&revs) < 0)
+ return error(_("error preparing revisions"));
+
+ init_merge_options(&merge_opt, the_repository);
+ memset(&result, 0, sizeof(result));
+ merge_opt.show_rename_progress = 1;
+ merge_opt.branch1 = "HEAD";
+ head_tree = get_commit_tree(onto);
+ result.tree = head_tree;
+ last_commit = onto;
+ while ((commit = get_revision(&revs))) {
+ struct commit *base;
+
+ fprintf(stderr, "Rebasing %s...\r",
+ oid_to_hex(&commit->object.oid));
+ assert(commit->parents && !commit->parents->next);
+ base = commit->parents->item;
+
+ next_tree = get_commit_tree(commit);
+ base_tree = get_commit_tree(base);
+
+ merge_opt.branch2 = short_commit_name(commit);
+ merge_opt.ancestor = xstrfmt("parent of %s", merge_opt.branch2);
+
+ merge_incore_nonrecursive(&merge_opt,
+ base_tree,
+ result.tree,
+ next_tree,
+ &result);
+
+ free((char*)merge_opt.ancestor);
+ merge_opt.ancestor = NULL;
+ if (!result.clean)
+ die("Aborting: Hit a conflict and restarting is not implemented.");
+ last_picked_commit = commit;
+ last_commit = create_commit(result.tree, commit, last_commit);
+ }
+ fprintf(stderr, "\nDone.\n");
+ /* TODO: There should be some kind of rev_info_free(&revs) call... */
+ memset(&revs, 0, sizeof(revs));
+
+ merge_switch_to_result(&merge_opt, head_tree, &result, 1, !result.clean);
+
+ if (result.clean < 0)
+ exit(128);
+
+ strbuf_addf(&reflog_msg, "finish rebase %s onto %s",
+ oid_to_hex(&last_picked_commit->object.oid),
+ oid_to_hex(&last_commit->object.oid));
+ if (update_ref(reflog_msg.buf, branch_name.buf,
+ &last_commit->object.oid,
+ &last_picked_commit->object.oid,
+ REF_NO_DEREF, UPDATE_REFS_MSG_ON_ERR)) {
+ error(_("could not update %s"), argv[4]);
+ die("Failed to update %s", argv[4]);
+ }
+ if (create_symref("HEAD", branch_name.buf, reflog_msg.buf) < 0)
+ die(_("unable to update HEAD"));
+ strbuf_release(&reflog_msg);
+ strbuf_release(&branch_name);
+
+ prime_cache_tree(the_repository, the_repository->index, result.tree);
+ if (write_locked_index(&the_index, &lock,
+ COMMIT_LOCK | SKIP_IF_UNCHANGED))
+ die(_("unable to write %s"), get_index_file());
+ return (clean == 0);
+}
diff --git a/t/helper/test-pkt-line.c b/t/helper/test-pkt-line.c
index 6915295..5e638f0 100644
--- a/t/helper/test-pkt-line.c
+++ b/t/helper/test-pkt-line.c
@@ -84,6 +84,25 @@ static void unpack_sideband(void)
}
}
+static int send_split_sideband(void)
+{
+ const char *part1 = "Hello,";
+ const char *primary = "\001primary: regular output\n";
+ const char *part2 = " world!\n";
+
+ send_sideband(1, 2, part1, strlen(part1), LARGE_PACKET_MAX);
+ packet_write(1, primary, strlen(primary));
+ send_sideband(1, 2, part2, strlen(part2), LARGE_PACKET_MAX);
+ packet_response_end(1);
+
+ return 0;
+}
+
+static int receive_sideband(void)
+{
+ return recv_sideband("sideband", 0, 1);
+}
+
int cmd__pkt_line(int argc, const char **argv)
{
if (argc < 2)
@@ -95,6 +114,10 @@ int cmd__pkt_line(int argc, const char **argv)
unpack();
else if (!strcmp(argv[1], "unpack-sideband"))
unpack_sideband();
+ else if (!strcmp(argv[1], "send-split-sideband"))
+ send_split_sideband();
+ else if (!strcmp(argv[1], "receive-sideband"))
+ receive_sideband();
else
die("invalid argument '%s'", argv[1]);
diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c
index a0d3966..9d6d14d 100644
--- a/t/helper/test-tool.c
+++ b/t/helper/test-tool.c
@@ -18,6 +18,7 @@ static struct test_cmd cmds[] = {
{ "bloom", cmd__bloom },
{ "chmtime", cmd__chmtime },
{ "config", cmd__config },
+ { "crontab", cmd__crontab },
{ "ctype", cmd__ctype },
{ "date", cmd__date },
{ "delta", cmd__delta },
@@ -28,6 +29,7 @@ static struct test_cmd cmds[] = {
{ "dump-split-index", cmd__dump_split_index },
{ "dump-untracked-cache", cmd__dump_untracked_cache },
{ "example-decorate", cmd__example_decorate },
+ { "fast-rebase", cmd__fast_rebase },
{ "genrandom", cmd__genrandom },
{ "genzeros", cmd__genzeros },
{ "hashmap", cmd__hashmap },
diff --git a/t/helper/test-tool.h b/t/helper/test-tool.h
index 07034d3..a6470ff 100644
--- a/t/helper/test-tool.h
+++ b/t/helper/test-tool.h
@@ -8,6 +8,7 @@ int cmd__advise_if_enabled(int argc, const char **argv);
int cmd__bloom(int argc, const char **argv);
int cmd__chmtime(int argc, const char **argv);
int cmd__config(int argc, const char **argv);
+int cmd__crontab(int argc, const char **argv);
int cmd__ctype(int argc, const char **argv);
int cmd__date(int argc, const char **argv);
int cmd__delta(int argc, const char **argv);
@@ -18,6 +19,7 @@ int cmd__dump_fsmonitor(int argc, const char **argv);
int cmd__dump_split_index(int argc, const char **argv);
int cmd__dump_untracked_cache(int argc, const char **argv);
int cmd__example_decorate(int argc, const char **argv);
+int cmd__fast_rebase(int argc, const char **argv);
int cmd__genrandom(int argc, const char **argv);
int cmd__genzeros(int argc, const char **argv);
int cmd__hashmap(int argc, const char **argv);
diff --git a/t/lib-merge.sh b/t/lib-merge.sh
new file mode 100644
index 0000000..8734ebf
--- /dev/null
+++ b/t/lib-merge.sh
@@ -0,0 +1,13 @@
+# Helper functions used by merge tests.
+
+test_expect_merge_algorithm () {
+ status_for_recursive=$1 status_for_ort=$2
+ shift 2
+
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_expect_${status_for_ort} "$@"
+ else
+ test_expect_${status_for_recursive} "$@"
+ fi
+}
diff --git a/t/lib-submodule-update.sh b/t/lib-submodule-update.sh
index 87a7591..bd3fa3c 100644
--- a/t/lib-submodule-update.sh
+++ b/t/lib-submodule-update.sh
@@ -144,7 +144,7 @@ create_lib_submodule_repo () {
git checkout -b valid_sub1 &&
git revert HEAD &&
- git checkout master
+ git checkout "${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME-master}"
)
}
diff --git a/t/perf/Makefile b/t/perf/Makefile
index 8c47155..fcb0e88 100644
--- a/t/perf/Makefile
+++ b/t/perf/Makefile
@@ -1,7 +1,7 @@
-include ../../config.mak
export GIT_TEST_OPTIONS
-all: perf
+all: test-lint perf
perf: pre-clean
./run
@@ -12,4 +12,7 @@ pre-clean:
clean:
rm -rf build "trash directory".* test-results
+test-lint:
+ $(MAKE) -C .. test-lint
+
.PHONY: all perf pre-clean clean
diff --git a/t/perf/README b/t/perf/README
index bd649af..fb9127a 100644
--- a/t/perf/README
+++ b/t/perf/README
@@ -28,6 +28,8 @@ the tests on the current git repository.
7810.3: grep --cached, cheap regex 3.07(3.02+0.25)
7810.4: grep --cached, expensive regex 9.39(30.57+0.24)
+Output format is in seconds "Elapsed(User + System)"
+
You can compare multiple repositories and even git revisions with the
'run' script:
diff --git a/t/perf/p3400-rebase.sh b/t/perf/p3400-rebase.sh
index d202aae..7a0bb29 100755
--- a/t/perf/p3400-rebase.sh
+++ b/t/perf/p3400-rebase.sh
@@ -9,16 +9,16 @@ test_expect_success 'setup rebasing on top of a lot of changes' '
git checkout -f -B base &&
git checkout -B to-rebase &&
git checkout -B upstream &&
- for i in $(seq 100)
+ for i in $(test_seq 100)
do
# simulate huge diffs
echo change$i >unrelated-file$i &&
- seq 1000 >>unrelated-file$i &&
+ test_seq 1000 >>unrelated-file$i &&
git add unrelated-file$i &&
test_tick &&
git commit -m commit$i unrelated-file$i &&
echo change$i >unrelated-file$i &&
- seq 1000 | tac >>unrelated-file$i &&
+ test_seq 1000 | tac >>unrelated-file$i &&
git add unrelated-file$i &&
test_tick &&
git commit -m commit$i-reverse unrelated-file$i ||
diff --git a/t/perf/p7519-fsmonitor.sh b/t/perf/p7519-fsmonitor.sh
index def7ecd..163a13b 100755
--- a/t/perf/p7519-fsmonitor.sh
+++ b/t/perf/p7519-fsmonitor.sh
@@ -22,7 +22,9 @@ test_description="Test core.fsmonitor"
#
# GIT_PERF_7519_UNTRACKED_CACHE: used to configure core.untrackedCache
# GIT_PERF_7519_SPLIT_INDEX: used to configure core.splitIndex
-# GIT_PERF_7519_FSMONITOR: used to configure core.fsMonitor
+# GIT_PERF_7519_FSMONITOR: used to configure core.fsMonitor. May be an
+# absolute path to an integration. May be a space delimited list of
+# absolute paths to integrations.
#
# The big win for using fsmonitor is the elimination of the need to scan the
# working directory looking for changed and untracked files. If the file
@@ -68,7 +70,7 @@ then
fi
fi
-test_expect_success "setup for fsmonitor" '
+test_expect_success "one time repo setup" '
# set untrackedCache depending on the environment
if test -n "$GIT_PERF_7519_UNTRACKED_CACHE"
then
@@ -88,24 +90,36 @@ test_expect_success "setup for fsmonitor" '
git config core.splitIndex "$GIT_PERF_7519_SPLIT_INDEX"
fi &&
+ mkdir 1_file 10_files 100_files 1000_files 10000_files &&
+ for i in $(test_seq 1 10); do touch 10_files/$i; done &&
+ for i in $(test_seq 1 100); do touch 100_files/$i; done &&
+ for i in $(test_seq 1 1000); do touch 1000_files/$i; done &&
+ for i in $(test_seq 1 10000); do touch 10000_files/$i; done &&
+ git add 1_file 10_files 100_files 1000_files 10000_files &&
+ git commit -qm "Add files" &&
+
+ # If Watchman exists, watch the work tree and attempt a query.
+ if test_have_prereq WATCHMAN; then
+ watchman watch "$GIT_WORK_TREE" &&
+ watchman watch-list | grep -q -F "$GIT_WORK_TREE"
+ fi
+'
+
+setup_for_fsmonitor() {
# set INTEGRATION_SCRIPT depending on the environment
- if test -n "$GIT_PERF_7519_FSMONITOR"
+ if test -n "$INTEGRATION_PATH"
then
- INTEGRATION_SCRIPT="$GIT_PERF_7519_FSMONITOR"
+ INTEGRATION_SCRIPT="$INTEGRATION_PATH"
else
#
# Choose integration script based on existence of Watchman.
- # If Watchman exists, watch the work tree and attempt a query.
- # If everything succeeds, use Watchman integration script,
- # else fall back to an empty integration script.
+ # Fall back to an empty integration script.
#
mkdir .git/hooks &&
if test_have_prereq WATCHMAN
then
INTEGRATION_SCRIPT=".git/hooks/fsmonitor-watchman" &&
- cp "$TEST_DIRECTORY/../templates/hooks--fsmonitor-watchman.sample" "$INTEGRATION_SCRIPT" &&
- watchman watch "$GIT_WORK_TREE" &&
- watchman watch-list | grep -q -F "$GIT_WORK_TREE"
+ cp "$TEST_DIRECTORY/../templates/hooks--fsmonitor-watchman.sample" "$INTEGRATION_SCRIPT"
else
INTEGRATION_SCRIPT=".git/hooks/fsmonitor-empty" &&
write_script "$INTEGRATION_SCRIPT"<<-\EOF
@@ -114,62 +128,94 @@ test_expect_success "setup for fsmonitor" '
fi &&
git config core.fsmonitor "$INTEGRATION_SCRIPT" &&
- git update-index --fsmonitor
-'
-
-if test -n "$GIT_PERF_7519_DROP_CACHE"; then
- test-tool drop-caches
-fi
-
-test_perf "status (fsmonitor=$INTEGRATION_SCRIPT)" '
- git status
-'
+ git update-index --fsmonitor 2>error &&
+ cat error &&
+ [ ! -s error ] # ensure no silent error
+}
+
+test_perf_w_drop_caches () {
+ if test -n "$GIT_PERF_7519_DROP_CACHE"; then
+ test-tool drop-caches
+ fi
-if test -n "$GIT_PERF_7519_DROP_CACHE"; then
- test-tool drop-caches
-fi
+ test_perf "$@"
+}
-test_perf "status -uno (fsmonitor=$INTEGRATION_SCRIPT)" '
- git status -uno
-'
+test_fsmonitor_suite() {
+ if test -n "$INTEGRATION_SCRIPT"; then
+ DESC="fsmonitor=$(basename $INTEGRATION_SCRIPT)"
+ else
+ DESC="fsmonitor=disabled"
+ fi
-if test -n "$GIT_PERF_7519_DROP_CACHE"; then
- test-tool drop-caches
+ test_expect_success "test_initialization" '
+ git reset --hard &&
+ git status # Warm caches
+ '
+
+ test_perf_w_drop_caches "status ($DESC)" '
+ git status
+ '
+
+ test_perf_w_drop_caches "status -uno ($DESC)" '
+ git status -uno
+ '
+
+ test_perf_w_drop_caches "status -uall ($DESC)" '
+ git status -uall
+ '
+
+ test_perf_w_drop_caches "status (dirty) ($DESC)" '
+ git ls-files | head -100000 | xargs -d "\n" touch -h &&
+ git status
+ '
+
+ test_perf_w_drop_caches "diff ($DESC)" '
+ git diff
+ '
+
+ test_perf_w_drop_caches "diff -- 0_files ($DESC)" '
+ git diff -- 1_file
+ '
+
+ test_perf_w_drop_caches "diff -- 10_files ($DESC)" '
+ git diff -- 10_files
+ '
+
+ test_perf_w_drop_caches "diff -- 100_files ($DESC)" '
+ git diff -- 100_files
+ '
+
+ test_perf_w_drop_caches "diff -- 1000_files ($DESC)" '
+ git diff -- 1000_files
+ '
+
+ test_perf_w_drop_caches "diff -- 10000_files ($DESC)" '
+ git diff -- 10000_files
+ '
+
+ test_perf_w_drop_caches "add ($DESC)" '
+ git add --all
+ '
+}
+
+if test -n "$GIT_PERF_7519_FSMONITOR"; then
+ for INTEGRATION_PATH in $GIT_PERF_7519_FSMONITOR; do
+ test_expect_success "setup for fsmonitor $INTEGRATION_PATH" 'setup_for_fsmonitor'
+ test_fsmonitor_suite
+ done
+else
+ test_expect_success "setup for fsmonitor" 'setup_for_fsmonitor'
+ test_fsmonitor_suite
fi
-test_perf "status -uall (fsmonitor=$INTEGRATION_SCRIPT)" '
- git status -uall
-'
-
test_expect_success "setup without fsmonitor" '
unset INTEGRATION_SCRIPT &&
git config --unset core.fsmonitor &&
git update-index --no-fsmonitor
'
-if test -n "$GIT_PERF_7519_DROP_CACHE"; then
- test-tool drop-caches
-fi
-
-test_perf "status (fsmonitor=$INTEGRATION_SCRIPT)" '
- git status
-'
-
-if test -n "$GIT_PERF_7519_DROP_CACHE"; then
- test-tool drop-caches
-fi
-
-test_perf "status -uno (fsmonitor=$INTEGRATION_SCRIPT)" '
- git status -uno
-'
-
-if test -n "$GIT_PERF_7519_DROP_CACHE"; then
- test-tool drop-caches
-fi
-
-test_perf "status -uall (fsmonitor=$INTEGRATION_SCRIPT)" '
- git status -uall
-'
+test_fsmonitor_suite
if test_have_prereq WATCHMAN
then
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index 923281a..22489c2 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -430,7 +430,7 @@ test_expect_success 'GIT_SKIP_TESTS does not skip unmatched suite' "
test_expect_success '--run basic' "
run_sub_test_lib_test run-basic \
- '--run basic' --run='1 3 5' <<-\\EOF &&
+ '--run basic' --run='1,3,5' <<-\\EOF &&
for i in 1 2 3 4 5 6
do
test_expect_success \"passing test #\$i\" 'true'
@@ -472,7 +472,7 @@ test_expect_success '--run with a range' "
test_expect_success '--run with two ranges' "
run_sub_test_lib_test run-two-ranges \
- '--run with two ranges' --run='1-2 5-6' <<-\\EOF &&
+ '--run with two ranges' --run='1-2,5-6' <<-\\EOF &&
for i in 1 2 3 4 5 6
do
test_expect_success \"passing test #\$i\" 'true'
@@ -556,7 +556,7 @@ test_expect_success '--run with basic negation' "
test_expect_success '--run with two negations' "
run_sub_test_lib_test run-two-neg \
- '--run with two negations' --run='"'!3 !6'"' <<-\\EOF &&
+ '--run with two negations' --run='"'!3,!6'"' <<-\\EOF &&
for i in 1 2 3 4 5 6
do
test_expect_success \"passing test #\$i\" 'true'
@@ -577,7 +577,7 @@ test_expect_success '--run with two negations' "
test_expect_success '--run a range and negation' "
run_sub_test_lib_test run-range-and-neg \
- '--run a range and negation' --run='"'-4 !2'"' <<-\\EOF &&
+ '--run a range and negation' --run='"'-4,!2'"' <<-\\EOF &&
for i in 1 2 3 4 5 6
do
test_expect_success \"passing test #\$i\" 'true'
@@ -620,7 +620,7 @@ test_expect_success '--run range negation' "
test_expect_success '--run include, exclude and include' "
run_sub_test_lib_test run-inc-neg-inc \
'--run include, exclude and include' \
- --run='"'1-5 !1-3 2'"' <<-\\EOF &&
+ --run='"'1-5,!1-3,2'"' <<-\\EOF &&
for i in 1 2 3 4 5 6
do
test_expect_success \"passing test #\$i\" 'true'
@@ -664,7 +664,7 @@ test_expect_success '--run include, exclude and include, comma separated' "
test_expect_success '--run exclude and include' "
run_sub_test_lib_test run-neg-inc \
'--run exclude and include' \
- --run='"'!3- 5'"' <<-\\EOF &&
+ --run='"'!3-,5'"' <<-\\EOF &&
for i in 1 2 3 4 5 6
do
test_expect_success \"passing test #\$i\" 'true'
@@ -705,7 +705,31 @@ test_expect_success '--run empty selectors' "
EOF
"
-test_expect_success '--run invalid range start' "
+test_expect_success '--run substring selector' "
+ run_sub_test_lib_test run-substring-selector \
+ '--run empty selectors' \
+ --run='relevant' <<-\\EOF &&
+ test_expect_success \"relevant test\" 'true'
+ for i in 1 2 3 4 5 6
+ do
+ test_expect_success \"other test #\$i\" 'true'
+ done
+ test_done
+ EOF
+ check_sub_test_lib_test run-substring-selector <<-\\EOF
+ > ok 1 - relevant test
+ > ok 2 # skip other test #1 (--run)
+ > ok 3 # skip other test #2 (--run)
+ > ok 4 # skip other test #3 (--run)
+ > ok 5 # skip other test #4 (--run)
+ > ok 6 # skip other test #5 (--run)
+ > ok 7 # skip other test #6 (--run)
+ > # passed all 7 test(s)
+ > 1..7
+ EOF
+"
+
+test_expect_success '--run keyword selection' "
run_sub_test_lib_test_err run-inv-range-start \
'--run invalid range start' \
--run='a-5' <<-\\EOF &&
@@ -735,21 +759,6 @@ test_expect_success '--run invalid range end' "
EOF_ERR
"
-test_expect_success '--run invalid selector' "
- run_sub_test_lib_test_err run-inv-selector \
- '--run invalid selector' \
- --run='1?' <<-\\EOF &&
- test_expect_success \"passing test #1\" 'true'
- test_done
- EOF
- check_sub_test_lib_test_err run-inv-selector \
- <<-\\EOF_OUT 3<<-\\EOF_ERR
- > FATAL: Unexpected exit with code 1
- EOF_OUT
- > error: --run: invalid non-numeric in test selector: '1?'
- EOF_ERR
-"
-
test_set_prereq HAVEIT
haveit=no
@@ -1191,7 +1200,7 @@ test_expect_success 'writing this tree with --missing-ok' '
test_expect_success 'git read-tree followed by write-tree should be idempotent' '
rm -f .git/index &&
git read-tree $tree &&
- test -f .git/index &&
+ test_path_is_file .git/index &&
newtree=$(git write-tree) &&
test "$newtree" = "$tree"
'
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index 2f7c3dc..69a3204 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -553,14 +553,21 @@ test_expect_success '--initial-branch' '
test_expect_success 'overridden default initial branch name (config)' '
test_config_global init.defaultBranch nmb &&
- git init initial-branch-config &&
+ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= git init initial-branch-config &&
git -C initial-branch-config symbolic-ref HEAD >actual &&
grep nmb actual
'
+test_expect_success 'overridden default main branch name (env)' '
+ test_config_global init.defaultBranch nmb &&
+ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=env git init main-branch-env &&
+ git -C main-branch-env symbolic-ref HEAD >actual &&
+ grep env actual
+'
+
test_expect_success 'invalid default branch name' '
- test_config_global init.defaultBranch "with space" &&
- test_must_fail git init initial-branch-invalid 2>err &&
+ test_must_fail env GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME="with space" \
+ git init initial-branch-invalid 2>err &&
test_i18ngrep "invalid branch name" err
'
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index 4bfffa9..f6deaf4 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -23,10 +23,6 @@ generate_random_characters () {
perl -pe "s/./chr((ord($&) % 26) + ord('a'))/sge" >"$TEST_ROOT/$NAME"
}
-file_size () {
- test-tool path-utils file-size "$1"
-}
-
filter_git () {
rm -f *.log &&
git "$@"
@@ -361,9 +357,9 @@ test_expect_success PERL 'required process filter should filter data' '
cp "$TEST_ROOT/test3 '\''sq'\'',\$x=.o" "testsubdir/test3 '\''sq'\'',\$x=.r" &&
>test4-empty.r &&
- S=$(file_size test.r) &&
- S2=$(file_size test2.r) &&
- S3=$(file_size "testsubdir/test3 '\''sq'\'',\$x=.r") &&
+ S=$(test_file_size test.r) &&
+ S2=$(test_file_size test2.r) &&
+ S3=$(test_file_size "testsubdir/test3 '\''sq'\'',\$x=.r") &&
M=$(git hash-object test.r) &&
M2=$(git hash-object test2.r) &&
M3=$(git hash-object "testsubdir/test3 '\''sq'\'',\$x=.r") &&
@@ -432,9 +428,9 @@ test_expect_success PERL 'required process filter should filter data for various
(
cd repo &&
- S=$(file_size test.r) &&
- S2=$(file_size test2.r) &&
- S3=$(file_size "testsubdir/test3 '\''sq'\'',\$x=.r") &&
+ S=$(test_file_size test.r) &&
+ S2=$(test_file_size test2.r) &&
+ S3=$(test_file_size "testsubdir/test3 '\''sq'\'',\$x=.r") &&
M=$(git hash-object test.r) &&
M2=$(git hash-object test2.r) &&
M3=$(git hash-object "testsubdir/test3 '\''sq'\'',\$x=.r") &&
@@ -549,7 +545,7 @@ test_expect_success PERL 'required process filter takes precedence' '
echo "*.r filter=protocol" >.gitattributes &&
cp "$TEST_ROOT/test.o" test.r &&
- S=$(file_size test.r) &&
+ S=$(test_file_size test.r) &&
# Check that the process filter is invoked here
filter_git add . &&
@@ -573,7 +569,7 @@ test_expect_success PERL 'required process filter should be used only for "clean
echo "*.r filter=protocol" >.gitattributes &&
cp "$TEST_ROOT/test.o" test.r &&
- S=$(file_size test.r) &&
+ S=$(test_file_size test.r) &&
filter_git add . &&
cat >expected.log <<-EOF &&
@@ -697,9 +693,9 @@ test_expect_success PERL 'process filter should restart after unexpected write f
echo "this is going to fail" >smudge-write-fail.o &&
cp smudge-write-fail.o smudge-write-fail.r &&
- S=$(file_size test.r) &&
- S2=$(file_size test2.r) &&
- SF=$(file_size smudge-write-fail.r) &&
+ S=$(test_file_size test.r) &&
+ S2=$(test_file_size test2.r) &&
+ SF=$(test_file_size smudge-write-fail.r) &&
M=$(git hash-object test.r) &&
M2=$(git hash-object test2.r) &&
MF=$(git hash-object smudge-write-fail.r) &&
@@ -752,9 +748,9 @@ test_expect_success PERL 'process filter should not be restarted if it signals a
echo "this will cause an error" >error.o &&
cp error.o error.r &&
- S=$(file_size test.r) &&
- S2=$(file_size test2.r) &&
- SE=$(file_size error.r) &&
+ S=$(test_file_size test.r) &&
+ S2=$(test_file_size test2.r) &&
+ SE=$(test_file_size error.r) &&
M=$(git hash-object test.r) &&
M2=$(git hash-object test2.r) &&
ME=$(git hash-object error.r) &&
@@ -797,7 +793,7 @@ test_expect_success PERL 'process filter abort stops processing of all further f
M="blob=$(git hash-object abort.r)" &&
rm -f debug.log &&
- SA=$(file_size abort.r) &&
+ SA=$(test_file_size abort.r) &&
git add . &&
rm -f *.r &&
@@ -859,7 +855,7 @@ test_expect_success PERL 'delayed checkout in process filter' '
git commit -m "test commit"
) &&
- S=$(file_size "$TEST_ROOT/test.o") &&
+ S=$(test_file_size "$TEST_ROOT/test.o") &&
PM="ref=refs/heads/master treeish=$(git -C repo rev-parse --verify master) " &&
M="${PM}blob=$(git -C repo rev-parse --verify master:test.a)" &&
cat >a.exp <<-EOF &&
diff --git a/t/t0068-for-each-repo.sh b/t/t0068-for-each-repo.sh
new file mode 100755
index 0000000..136b4ec
--- /dev/null
+++ b/t/t0068-for-each-repo.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+test_description='git for-each-repo builtin'
+
+. ./test-lib.sh
+
+test_expect_success 'run based on configured value' '
+ git init one &&
+ git init two &&
+ git init three &&
+ git -C two commit --allow-empty -m "DID NOT RUN" &&
+ git config run.key "$TRASH_DIRECTORY/one" &&
+ git config --add run.key "$TRASH_DIRECTORY/three" &&
+ git for-each-repo --config=run.key commit --allow-empty -m "ran" &&
+ git -C one log -1 --pretty=format:%s >message &&
+ grep ran message &&
+ git -C two log -1 --pretty=format:%s >message &&
+ ! grep ran message &&
+ git -C three log -1 --pretty=format:%s >message &&
+ grep ran message &&
+ git for-each-repo --config=run.key -- commit --allow-empty -m "ran again" &&
+ git -C one log -1 --pretty=format:%s >message &&
+ grep again message &&
+ git -C two log -1 --pretty=format:%s >message &&
+ ! grep again message &&
+ git -C three log -1 --pretty=format:%s >message &&
+ grep again message
+'
+
+test_done
diff --git a/t/t0070-fundamental.sh b/t/t0070-fundamental.sh
index 7b111a5..8d59905 100755
--- a/t/t0070-fundamental.sh
+++ b/t/t0070-fundamental.sh
@@ -34,4 +34,22 @@ test_expect_success 'check for a bug in the regex routines' '
test-tool regex --bug
'
+test_expect_success 'incomplete sideband messages are reassembled' '
+ test-tool pkt-line send-split-sideband >split-sideband &&
+ test-tool pkt-line receive-sideband <split-sideband 2>err &&
+ grep "Hello, world" err
+'
+
+test_expect_success 'eof on sideband message is reported' '
+ printf 1234 >input &&
+ test-tool pkt-line receive-sideband <input 2>err &&
+ test_i18ngrep "unexpected disconnect" err
+'
+
+test_expect_success 'missing sideband designator is reported' '
+ printf 0004 >input &&
+ test-tool pkt-line receive-sideband <input 2>err &&
+ test_i18ngrep "missing sideband" err
+'
+
test_done
diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh
index bc2d740..a18f8a4 100755
--- a/t/t0300-credentials.sh
+++ b/t/t0300-credentials.sh
@@ -265,6 +265,32 @@ test_expect_success 'internal getpass does not ask for known username' '
EOF
'
+test_expect_success 'git-credential respects core.askPass' '
+ write_script alternate-askpass <<-\EOF &&
+ echo >&2 "alternate askpass invoked"
+ echo alternate-value
+ EOF
+ test_config core.askpass "$PWD/alternate-askpass" &&
+ (
+ # unset GIT_ASKPASS set by lib-credential.sh which would
+ # override our config, but do so in a subshell so that we do
+ # not interfere with other tests
+ sane_unset GIT_ASKPASS &&
+ check fill <<-\EOF
+ protocol=http
+ host=example.com
+ --
+ protocol=http
+ host=example.com
+ username=alternate-value
+ password=alternate-value
+ --
+ alternate askpass invoked
+ alternate askpass invoked
+ EOF
+ )
+'
+
HELPER="!f() {
cat >/dev/null
echo username=foo
diff --git a/t/t1004-read-tree-m-u-wf.sh b/t/t1004-read-tree-m-u-wf.sh
index c13578a..181956b 100755
--- a/t/t1004-read-tree-m-u-wf.sh
+++ b/t/t1004-read-tree-m-u-wf.sh
@@ -20,7 +20,7 @@ test_expect_success 'two-way setup' '
git branch side &&
git tag -f branch-point &&
- echo file2 is not tracked on the master anymore &&
+ echo file2 is not tracked on the master branch anymore &&
rm -f file2 subdir/file2 &&
git update-index --remove file2 subdir/file2 &&
git commit -a -m "master removes file2 and subdir/file2"
diff --git a/t/t1050-large.sh b/t/t1050-large.sh
index 61e89a8..4bab6a5 100755
--- a/t/t1050-large.sh
+++ b/t/t1050-large.sh
@@ -5,12 +5,6 @@ test_description='adding and checking out large blobs'
. ./test-lib.sh
-# This should be moved to test-lib.sh together with the
-# copy in t0021 after both topics have graduated to 'master'.
-file_size () {
- test-tool path-utils file-size "$1"
-}
-
test_expect_success setup '
# clone does not allow us to pass core.bigfilethreshold to
# new repos, so set core.bigfilethreshold globally
@@ -29,7 +23,7 @@ do
test_expect_success "add with $config" '
test_when_finished "rm -f .git/objects/pack/pack-*.* .git/index" &&
git $config add large1 &&
- sz=$(file_size .git/objects/pack/pack-*.pack) &&
+ sz=$(test_file_size .git/objects/pack/pack-*.pack) &&
case "$expect" in
small) test "$sz" -le 100000 ;;
large) test "$sz" -ge 100000 ;;
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index 770e7be..4c01e08 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -585,10 +585,10 @@ test_expect_success 'stdin fails on unbalanced quotes' '
grep "fatal: badly quoted argument: \\\"master" err
'
-test_expect_success 'stdin fails on invalid escape' '
- echo "create $a \"ma\zter\"" >stdin &&
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin fails on invalid escape' '
+ echo "create $a \"ma\zn\"" >stdin &&
test_must_fail git update-ref --stdin <stdin 2>err &&
- grep "fatal: badly quoted argument: \\\"ma\\\\zter\\\"" err
+ grep "fatal: badly quoted argument: \\\"ma\\\\zn\\\"" err
'
test_expect_success 'stdin fails on junk after quoted argument' '
@@ -704,9 +704,9 @@ test_expect_success 'stdin succeeds with quoted argument' '
test_cmp expect actual
'
-test_expect_success 'stdin succeeds with escaped character' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin succeeds with escaped character' '
git update-ref -d $a &&
- echo "create $a \"ma\\163ter\"" >stdin &&
+ echo "create $a \"ma\\151n\"" >stdin &&
git update-ref --stdin <stdin &&
git rev-parse $m >expect &&
git rev-parse $a >actual &&
diff --git a/t/t2004-checkout-cache-temp.sh b/t/t2004-checkout-cache-temp.sh
index a12afe9..a9352b0 100755
--- a/t/t2004-checkout-cache-temp.sh
+++ b/t/t2004-checkout-cache-temp.sh
@@ -88,9 +88,17 @@ test_expect_success 'checkout all stage 2 to temporary files' '
done
'
+test_expect_success 'checkout all stages of unknown path' '
+ rm -f path* .merge_* actual &&
+ test_must_fail git checkout-index --stage=all --temp \
+ -- does-not-exist 2>stderr &&
+ test_i18ngrep not.in.the.cache stderr
+'
+
test_expect_success 'checkout all stages/one file to nothing' '
rm -f path* .merge_* actual &&
- git checkout-index --stage=all --temp -- path0 >actual &&
+ git checkout-index --stage=all --temp -- path0 >actual 2>stderr &&
+ test_must_be_empty stderr &&
test_line_count = 0 actual
'
diff --git a/t/t2006-checkout-index-basic.sh b/t/t2006-checkout-index-basic.sh
index 57cbdfe..8e181db 100755
--- a/t/t2006-checkout-index-basic.sh
+++ b/t/t2006-checkout-index-basic.sh
@@ -21,4 +21,15 @@ test_expect_success 'checkout-index -h in broken repository' '
test_i18ngrep "[Uu]sage" broken/usage
'
+test_expect_success 'checkout-index reports errors (cmdline)' '
+ test_must_fail git checkout-index -- does-not-exist 2>stderr &&
+ test_i18ngrep not.in.the.cache stderr
+'
+
+test_expect_success 'checkout-index reports errors (stdin)' '
+ echo does-not-exist |
+ test_must_fail git checkout-index --stdin 2>stderr &&
+ test_i18ngrep not.in.the.cache stderr
+'
+
test_done
diff --git a/t/t2016-checkout-patch.sh b/t/t2016-checkout-patch.sh
index 47aeb0b..d91a329 100755
--- a/t/t2016-checkout-patch.sh
+++ b/t/t2016-checkout-patch.sh
@@ -18,6 +18,10 @@ test_expect_success PERL 'setup' '
# note: bar sorts before dir/foo, so the first 'n' is always to skip 'bar'
+# NEEDSWORK: Since the builtin add-p is used when $GIT_TEST_ADD_I_USE_BUILTIN
+# is given, we should replace the PERL prerequisite with an ADD_I prerequisite
+# which first checks if $GIT_TEST_ADD_I_USE_BUILTIN is defined before checking
+# PERL.
test_expect_success PERL 'saying "n" does nothing' '
set_and_save_state dir/foo work head &&
test_write_lines n n | git checkout -p &&
@@ -59,6 +63,13 @@ test_expect_success PERL 'git checkout -p HEAD with change already staged' '
verify_state dir/foo head head
'
+test_expect_success PERL 'git checkout -p HEAD^...' '
+ # the third n is to get out in case it mistakenly does not apply
+ test_write_lines n y n | git checkout -p HEAD^... &&
+ verify_saved_state bar &&
+ verify_state dir/foo parent parent
+'
+
test_expect_success PERL 'git checkout -p HEAD^' '
# the third n is to get out in case it mistakenly does not apply
test_write_lines n y n | git checkout -p HEAD^ &&
diff --git a/t/t2024-checkout-dwim.sh b/t/t2024-checkout-dwim.sh
index accfa9a..a4f8d3a 100755
--- a/t/t2024-checkout-dwim.sh
+++ b/t/t2024-checkout-dwim.sh
@@ -166,6 +166,17 @@ test_expect_success '--no-guess suppresses branch auto-vivification' '
test_branch master
'
+test_expect_success 'checkout.guess = false suppresses branch auto-vivification' '
+ git checkout -B master &&
+ status_uno_is_clean &&
+ test_might_fail git branch -D bar &&
+
+ test_config checkout.guess false &&
+ test_must_fail git checkout bar &&
+ test_must_fail git rev-parse --verify refs/heads/bar &&
+ test_branch master
+'
+
test_expect_success 'setup more remotes with unconventional refspecs' '
git checkout -B master &&
status_uno_is_clean &&
diff --git a/t/t2060-switch.sh b/t/t2060-switch.sh
index 2c1b8c0..68c9101 100755
--- a/t/t2060-switch.sh
+++ b/t/t2060-switch.sh
@@ -85,9 +85,12 @@ test_expect_success 'switching ignores file of same branch name' '
test_cmp expected actual
'
-test_expect_success 'guess and create branch ' '
+test_expect_success 'guess and create branch' '
test_when_finished git switch master &&
test_must_fail git switch --no-guess foo &&
+ test_config checkout.guess false &&
+ test_must_fail git switch foo &&
+ test_config checkout.guess true &&
git switch foo &&
echo refs/heads/foo >expected &&
git symbolic-ref HEAD >actual &&
diff --git a/t/t2071-restore-patch.sh b/t/t2071-restore-patch.sh
index 98b2476..b5c5c0f 100755
--- a/t/t2071-restore-patch.sh
+++ b/t/t2071-restore-patch.sh
@@ -60,6 +60,14 @@ test_expect_success PERL 'git restore -p --source=HEAD^' '
verify_state dir/foo parent index
'
+test_expect_success PERL 'git restore -p --source=HEAD^...' '
+ set_state dir/foo work index &&
+ # the third n is to get out in case it mistakenly does not apply
+ test_write_lines n y n | git restore -p --source=HEAD^... &&
+ verify_saved_state bar &&
+ verify_state dir/foo parent index
+'
+
test_expect_success PERL 'git restore -p handles deletion' '
set_state dir/foo work index &&
rm dir/foo &&
diff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh
index f764b7e..7cb7a70 100755
--- a/t/t2200-add-update.sh
+++ b/t/t2200-add-update.sh
@@ -179,7 +179,8 @@ test_expect_success 'add -u resolves unmerged paths' '
test_expect_success '"add -u non-existent" should fail' '
test_must_fail git add -u non-existent &&
- ! (git ls-files | grep "non-existent")
+ git ls-files >actual &&
+ ! grep "non-existent" actual
'
test_done
diff --git a/t/t2402-worktree-list.sh b/t/t2402-worktree-list.sh
index 52585ec..795ddca 100755
--- a/t/t2402-worktree-list.sh
+++ b/t/t2402-worktree-list.sh
@@ -61,6 +61,16 @@ test_expect_success '"list" all worktrees --porcelain' '
test_cmp expect actual
'
+test_expect_success '"list" all worktrees with locked annotation' '
+ test_when_finished "rm -rf locked unlocked out && git worktree prune" &&
+ git worktree add --detach locked master &&
+ git worktree add --detach unlocked master &&
+ git worktree lock locked &&
+ git worktree list >out &&
+ grep "/locked *[0-9a-f].* locked$" out &&
+ ! grep "/unlocked *[0-9a-f].* locked$" out
+'
+
test_expect_success 'bare repo setup' '
git init --bare bare1 &&
echo "data" >file1 &&
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 6efe7a4..a0b832d 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -321,11 +321,11 @@ test_expect_success 'git branch --list -v with --abbrev' '
'
-test_expect_success 'git branch --column' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch --column' '
COLUMNS=81 git branch --column=column >actual &&
cat >expect <<\EOF &&
- a/b/c bam foo l * master n o/p r
- abc bar j/k m/m mb o/o q topic
+ a/b/c bam foo l * main n o/p r
+ abc bar j/k m/m mb o/o q topic
EOF
test_cmp expect actual
'
@@ -358,15 +358,15 @@ EOF
test_cmp expect actual
'
-test_expect_success 'git branch with column.*' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch with column.*' '
git config column.ui column &&
git config column.branch "dense" &&
COLUMNS=80 git branch >actual &&
git config --unset column.branch &&
git config --unset column.ui &&
cat >expect <<\EOF &&
- a/b/c bam foo l * master n o/p r
- abc bar j/k m/m mb o/o q topic
+ a/b/c bam foo l * main n o/p r
+ abc bar j/k m/m mb o/o q topic
EOF
test_cmp expect actual
'
@@ -375,9 +375,9 @@ test_expect_success 'git branch --column -v should fail' '
test_must_fail git branch --column -v
'
-test_expect_success 'git branch -v with column.ui ignored' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch -v with column.ui ignored' '
git config column.ui column &&
- COLUMNS=80 git branch -v | cut -c -9 | sed "s/ *$//" >actual &&
+ COLUMNS=80 git branch -v | cut -c -8 | sed "s/ *$//" >actual &&
git config --unset column.ui &&
cat >expect <<\EOF &&
a/b/c
diff --git a/t/t3201-branch-contains.sh b/t/t3201-branch-contains.sh
index efea5c4..3733cd0 100755
--- a/t/t3201-branch-contains.sh
+++ b/t/t3201-branch-contains.sh
@@ -242,7 +242,7 @@ test_expect_success 'branch --merged combined with --no-merged' '
# Here "topic" tracks "master" with one extra commit, and "zzz" points to the
# same tip as master The name "zzz" must come alphabetically after "topic"
# as we process them in that order.
-test_expect_success 'branch --merged with --verbose' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'branch --merged with --verbose' '
git branch --track topic master &&
git branch zzz topic &&
git checkout topic &&
@@ -256,9 +256,9 @@ test_expect_success 'branch --merged with --verbose' '
test_cmp expect actual &&
git branch --verbose --merged topic >actual &&
cat >expect <<-EOF &&
- master $(git rev-parse --short master) second on master
- * topic $(git rev-parse --short topic ) [ahead 1] foo
- zzz $(git rev-parse --short zzz ) second on master
+ main $(git rev-parse --short main) second on main
+ * topic $(git rev-parse --short topic ) [ahead 1] foo
+ zzz $(git rev-parse --short zzz ) second on main
EOF
test_i18ncmp expect actual
'
diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh
index 71818b9..d655865 100755
--- a/t/t3203-branch-output.sh
+++ b/t/t3203-branch-output.sh
@@ -329,7 +329,7 @@ test_expect_success '--color overrides auto-color' '
test_cmp expect.color actual
'
-test_expect_success 'verbose output lists worktree path' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output lists worktree path' '
one=$(git rev-parse --short HEAD) &&
two=$(git rev-parse --short master) &&
cat >expect <<-EOF &&
@@ -337,7 +337,7 @@ test_expect_success 'verbose output lists worktree path' '
ambiguous $one one
branch-one $two two
+ branch-two $one ($(pwd)/worktree_dir) one
- master $two two
+ main $two two
ref-to-branch $two two
ref-to-remote $two two
EOF
diff --git a/t/t3205-branch-color.sh b/t/t3205-branch-color.sh
index 4f1e16b..289625c 100755
--- a/t/t3205-branch-color.sh
+++ b/t/t3205-branch-color.sh
@@ -28,12 +28,12 @@ test_expect_success 'regular output shows colors' '
test_cmp expect actual
'
-test_expect_success 'verbose output shows colors' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output shows colors' '
oid=$(git rev-parse --short HEAD) &&
cat >expect <<-EOF &&
- * <CYAN>master <RESET> $oid foo
- <BLUE>other <RESET> $oid foo
- <YELLOW>remotes/origin/master<RESET> $oid foo
+ * <CYAN>main <RESET> $oid foo
+ <BLUE>other <RESET> $oid foo
+ <YELLOW>remotes/origin/main<RESET> $oid foo
EOF
git branch --color -v -a >actual.raw &&
test_decode_color <actual.raw >actual &&
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 07a1617..1e56696 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -1797,6 +1797,17 @@ test_expect_success 'todo has correct onto hash' '
test_i18ngrep "^# Rebase ..* onto $onto" actual
'
+test_expect_success 'ORIG_HEAD is updated correctly' '
+ test_when_finished "git checkout master && git branch -D test-orig-head" &&
+ git checkout -b test-orig-head A &&
+ git commit --allow-empty -m A1 &&
+ git commit --allow-empty -m A2 &&
+ git commit --allow-empty -m A3 &&
+ git commit --allow-empty -m A4 &&
+ git rebase master &&
+ test_cmp_rev ORIG_HEAD test-orig-head@{1}
+'
+
# This must be the last test in this file
test_expect_success '$EDITOR and friends are unchanged' '
test_editor_unchanged
diff --git a/t/t3406-rebase-message.sh b/t/t3406-rebase-message.sh
index 927a4f4..4afc528 100755
--- a/t/t3406-rebase-message.sh
+++ b/t/t3406-rebase-message.sh
@@ -46,22 +46,22 @@ test_expect_success 'rebase fast-forward to master' '
test_expect_success 'rebase --stat' '
git reset --hard start &&
- git rebase --stat master >diffstat.txt &&
- grep "^ fileX | *1 +$" diffstat.txt
+ git rebase --stat master >diffstat.txt &&
+ grep "^ fileX | *1 +$" diffstat.txt
'
test_expect_success 'rebase w/config rebase.stat' '
git reset --hard start &&
- git config rebase.stat true &&
- git rebase master >diffstat.txt &&
- grep "^ fileX | *1 +$" diffstat.txt
+ git config rebase.stat true &&
+ git rebase master >diffstat.txt &&
+ grep "^ fileX | *1 +$" diffstat.txt
'
test_expect_success 'rebase -n overrides config rebase.stat config' '
git reset --hard start &&
- git config rebase.stat true &&
- git rebase -n master >diffstat.txt &&
- ! grep "^ fileX | *1 +$" diffstat.txt
+ git config rebase.stat true &&
+ git rebase -n master >diffstat.txt &&
+ ! grep "^ fileX | *1 +$" diffstat.txt
'
# Output to stderr:
diff --git a/t/t3427-rebase-subtree.sh b/t/t3427-rebase-subtree.sh
index 2a7d958..5839719 100755
--- a/t/t3427-rebase-subtree.sh
+++ b/t/t3427-rebase-subtree.sh
@@ -19,7 +19,7 @@ commit_message() {
# \
# README ---------------------- Add subproject master - topic_4 - files_subtree/topic_5
#
-# Where the merge moves the files master[123].t into the subdirectory
+# Where the merge moves the files topic_[123].t into the subdirectory
# files_subtree/ and topic_4 as well as files_subtree/topic_5 add files to that
# directory directly.
#
diff --git a/t/t3435-rebase-gpg-sign.sh b/t/t3435-rebase-gpg-sign.sh
index b47c59c..54120b0 100755
--- a/t/t3435-rebase-gpg-sign.sh
+++ b/t/t3435-rebase-gpg-sign.sh
@@ -68,4 +68,60 @@ test_expect_failure 'rebase -p --no-gpg-sign override commit.gpgsign' '
test_must_fail git verify-commit HEAD
'
+test_expect_success 'rebase -r, merge strategy, --gpg-sign will sign commit' '
+ git reset --hard merged &&
+ test_unconfig commit.gpgsign &&
+ git rebase -fr --gpg-sign -s resolve --root &&
+ git verify-commit HEAD
+'
+
+test_expect_success 'rebase -r, merge strategy, commit.gpgsign=true will sign commit' '
+ git reset --hard merged &&
+ git config commit.gpgsign true &&
+ git rebase -fr -s resolve --root &&
+ git verify-commit HEAD
+'
+
+test_expect_success 'rebase -r, merge strategy, commit.gpgsign=false --gpg-sign will sign commit' '
+ git reset --hard merged &&
+ git config commit.gpgsign false &&
+ git rebase -fr --gpg-sign -s resolve --root &&
+ git verify-commit HEAD
+'
+
+test_expect_success "rebase -r, merge strategy, commit.gpgsign=true --no-gpg-sign won't sign commit" '
+ git reset --hard merged &&
+ git config commit.gpgsign true &&
+ git rebase -fr --no-gpg-sign -s resolve --root &&
+ test_must_fail git verify-commit HEAD
+'
+
+test_expect_success 'rebase -r --gpg-sign will sign commit' '
+ git reset --hard merged &&
+ test_unconfig commit.gpgsign &&
+ git rebase -fr --gpg-sign --root &&
+ git verify-commit HEAD
+'
+
+test_expect_success 'rebase -r with commit.gpgsign=true will sign commit' '
+ git reset --hard merged &&
+ git config commit.gpgsign true &&
+ git rebase -fr --root &&
+ git verify-commit HEAD
+'
+
+test_expect_success 'rebase -r --gpg-sign with commit.gpgsign=false will sign commit' '
+ git reset --hard merged &&
+ git config commit.gpgsign false &&
+ git rebase -fr --gpg-sign --root &&
+ git verify-commit HEAD
+'
+
+test_expect_success "rebase -r --no-gpg-sign with commit.gpgsign=true won't sign commit" '
+ git reset --hard merged &&
+ git config commit.gpgsign true &&
+ git rebase -fr --no-gpg-sign --root &&
+ test_must_fail git verify-commit HEAD
+'
+
test_done
diff --git a/t/t3920-crlf-messages.sh b/t/t3920-crlf-messages.sh
new file mode 100755
index 0000000..70ddce3
--- /dev/null
+++ b/t/t3920-crlf-messages.sh
@@ -0,0 +1,126 @@
+#!/bin/sh
+
+test_description='Test ref-filter and pretty APIs for commit and tag messages using CRLF'
+. ./test-lib.sh
+
+LIB_CRLF_BRANCHES=""
+
+create_crlf_ref () {
+ branch="$1" &&
+ cat >.crlf-orig-$branch.txt &&
+ cat .crlf-orig-$branch.txt | append_cr >.crlf-message-$branch.txt &&
+ grep 'Subject' .crlf-orig-$branch.txt | tr '\n' ' ' | sed 's/[ ]*$//' | tr -d '\n' >.crlf-subject-$branch.txt &&
+ grep 'Body' .crlf-message-$branch.txt >.crlf-body-$branch.txt || true &&
+ LIB_CRLF_BRANCHES="${LIB_CRLF_BRANCHES} ${branch}" &&
+ test_tick &&
+ hash=$(git commit-tree HEAD^{tree} -p HEAD -F .crlf-message-${branch}.txt) &&
+ git branch ${branch} ${hash} &&
+ git tag tag-${branch} ${branch} -F .crlf-message-${branch}.txt --cleanup=verbatim
+}
+
+create_crlf_refs () {
+ create_crlf_ref crlf <<-\EOF &&
+ Subject first line
+
+ Body first line
+ Body second line
+ EOF
+ create_crlf_ref crlf-empty-lines-after-subject <<-\EOF &&
+ Subject first line
+
+
+ Body first line
+ Body second line
+ EOF
+ create_crlf_ref crlf-two-line-subject <<-\EOF &&
+ Subject first line
+ Subject second line
+
+ Body first line
+ Body second line
+ EOF
+ create_crlf_ref crlf-two-line-subject-no-body <<-\EOF &&
+ Subject first line
+ Subject second line
+ EOF
+ create_crlf_ref crlf-two-line-subject-no-body-trailing-newline <<-\EOF
+ Subject first line
+ Subject second line
+
+ EOF
+}
+
+test_crlf_subject_body_and_contents() {
+ command_and_args="$@" &&
+ command=$1 &&
+ if test ${command} = "branch" || test ${command} = "for-each-ref" || test ${command} = "tag"
+ then
+ atoms="(contents:subject) (contents:body) (contents)"
+ elif test ${command} = "log" || test ${command} = "show"
+ then
+ atoms="s b B"
+ fi &&
+ files="subject body message" &&
+ while test -n "${atoms}"
+ do
+ set ${atoms} && atom=$1 && shift && atoms="$*" &&
+ set ${files} && file=$1 && shift && files="$*" &&
+ test_expect_success "${command}: --format='%${atom}' works with messages using CRLF" "
+ rm -f expect &&
+ for ref in ${LIB_CRLF_BRANCHES}
+ do
+ cat .crlf-${file}-\"\${ref}\".txt >>expect &&
+ printf \"\n\" >>expect
+ done &&
+ git $command_and_args --format=\"%${atom}\" >actual &&
+ test_cmp expect actual
+ "
+ done
+}
+
+
+test_expect_success 'Setup refs with commit and tag messages using CRLF' '
+ test_commit inital &&
+ create_crlf_refs
+'
+
+test_expect_success 'branch: --verbose works with messages using CRLF' '
+ rm -f expect &&
+ for branch in $LIB_CRLF_BRANCHES
+ do
+ printf " " >>expect &&
+ cat .crlf-subject-${branch}.txt >>expect &&
+ printf "\n" >>expect
+ done &&
+ git branch -v >tmp &&
+ # Remove first two columns, and the line for the currently checked out branch
+ current=$(git branch --show-current) &&
+ grep -v $current <tmp | awk "{\$1=\$2=\"\"}1" >actual &&
+ test_cmp expect actual
+'
+
+test_crlf_subject_body_and_contents branch --list crlf*
+
+test_crlf_subject_body_and_contents tag --list tag-crlf*
+
+test_crlf_subject_body_and_contents for-each-ref refs/heads/crlf*
+
+test_expect_success 'log: --oneline works with messages using CRLF' '
+ for branch in $LIB_CRLF_BRANCHES
+ do
+ cat .crlf-subject-${branch}.txt >expect &&
+ printf "\n" >>expect &&
+ git log --oneline -1 ${branch} >tmp-branch &&
+ git log --oneline -1 tag-${branch} >tmp-tag &&
+ cut -d" " -f2- <tmp-branch >actual-branch &&
+ cut -d" " -f2- <tmp-tag >actual-tag &&
+ test_cmp expect actual-branch &&
+ test_cmp expect actual-tag || return 1
+ done
+'
+
+test_crlf_subject_body_and_contents log --all --reverse --grep Subject
+
+test_crlf_subject_body_and_contents show $LIB_CRLF_BRANCHES
+
+test_done
diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
index 5c7b012..f72d456 100755
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
@@ -6,6 +6,7 @@
test_description='Various diff formatting options'
. ./test-lib.sh
+. "$TEST_DIRECTORY"/diff-lib.sh
test_expect_success setup '
@@ -333,6 +334,7 @@ log -SF master --max-count=2
log -GF master
log -GF -p master
log -GF -p --pickaxe-all master
+log -IA -IB -I1 -I2 -p master
log --decorate --all
log --decorate=full --all
@@ -473,4 +475,43 @@ test_expect_success 'diff-tree --stdin with log formatting' '
test_cmp expect actual
'
+test_expect_success 'diff -I<regex>: setup' '
+ git checkout master &&
+ test_seq 50 >file0 &&
+ git commit -m "Set up -I<regex> test file" file0 &&
+ test_seq 50 | sed -e "s/13/ten and three/" -e "/7\$/d" >file0 &&
+ echo >>file0
+'
+test_expect_success 'diff -I<regex>' '
+ git diff --ignore-blank-lines -I"ten.*e" -I"^[124-9]" >actual &&
+ cat >expect <<-\EOF &&
+ diff --git a/file0 b/file0
+ --- a/file0
+ +++ b/file0
+ @@ -34,7 +31,6 @@
+ 34
+ 35
+ 36
+ -37
+ 38
+ 39
+ 40
+ EOF
+ compare_diff_patch expect actual
+'
+
+test_expect_success 'diff -I<regex> --stat' '
+ git diff --stat --ignore-blank-lines -I"ten.*e" -I"^[124-9]" >actual &&
+ cat >expect <<-\EOF &&
+ file0 | 1 -
+ 1 file changed, 1 deletion(-)
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'diff -I<regex>: detect malformed regex' '
+ test_expect_code 129 git diff --ignore-matching-lines="^[124-9" 2>error &&
+ test_i18ngrep "invalid regex given to -I: " error
+'
+
test_done
diff --git a/t/t4013/diff.log_-IA_-IB_-I1_-I2_-p_master b/t/t4013/diff.log_-IA_-IB_-I1_-I2_-p_master
new file mode 100644
index 0000000..929f35a
--- /dev/null
+++ b/t/t4013/diff.log_-IA_-IB_-I1_-I2_-p_master
@@ -0,0 +1,99 @@
+$ git log -IA -IB -I1 -I2 -p master
+commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
+Merge: 9a6d494 c7a2ab9
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:04:00 2006 +0000
+
+ Merge branch 'side'
+
+commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:03:00 2006 +0000
+
+ Side
+
+diff --git a/file0 b/file0
+index 01e79c3..f4615da 100644
+--- a/file0
++++ b/file0
+@@ -1,3 +1,6 @@
+ 1
+ 2
+ 3
++A
++B
++C
+diff --git a/file3 b/file3
+new file mode 100644
+index 0000000..7289e35
+
+commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:02:00 2006 +0000
+
+ Third
+
+diff --git a/dir/sub b/dir/sub
+index 8422d40..cead32e 100644
+--- a/dir/sub
++++ b/dir/sub
+@@ -2,3 +2,5 @@ A
+ B
+ C
+ D
++E
++F
+diff --git a/file1 b/file1
+new file mode 100644
+index 0000000..b1e6722
+--- /dev/null
++++ b/file1
+@@ -0,0 +1,3 @@
++A
++B
++C
+
+commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:01:00 2006 +0000
+
+ Second
+
+ This is the second commit.
+
+diff --git a/dir/sub b/dir/sub
+index 35d242b..8422d40 100644
+--- a/dir/sub
++++ b/dir/sub
+@@ -1,2 +1,4 @@
+ A
+ B
++C
++D
+diff --git a/file0 b/file0
+index 01e79c3..b414108 100644
+--- a/file0
++++ b/file0
+@@ -1,3 +1,6 @@
+ 1
+ 2
+ 3
++4
++5
++6
+diff --git a/file2 b/file2
+deleted file mode 100644
+index 01e79c3..0000000
+--- a/file2
++++ /dev/null
+@@ -1,3 +0,0 @@
+-1
+-2
+-3
+
+commit 444ac553ac7612cc88969031b02b3767fb8a353a
+Author: A U Thor <author@example.com>
+Date: Mon Jun 26 00:00:00 2006 +0000
+
+ Initial
+$
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 294e76c..42588bf 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -1919,6 +1919,39 @@ test_expect_success 'format-patch -o overrides format.outputDirectory' '
test_path_is_dir patchset
'
+test_expect_success 'format-patch forbids multiple outputs' '
+ rm -fr outfile outdir &&
+ test_must_fail \
+ git format-patch --stdout --output-directory=outdir &&
+ test_must_fail \
+ git format-patch --stdout --output=outfile &&
+ test_must_fail \
+ git format-patch --output=outfile --output-directory=outdir
+'
+
+test_expect_success 'configured outdir does not conflict with output options' '
+ rm -fr outfile outdir &&
+ test_config format.outputDirectory outdir &&
+ git format-patch --stdout &&
+ test_path_is_missing outdir &&
+ git format-patch --output=outfile &&
+ test_path_is_missing outdir
+'
+
+test_expect_success 'format-patch --output' '
+ rm -fr outfile &&
+ git format-patch -3 --stdout HEAD >expect &&
+ git format-patch -3 --output=outfile HEAD &&
+ test_cmp expect outfile
+'
+
+test_expect_success 'format-patch --cover-letter --output' '
+ rm -fr outfile &&
+ git format-patch --cover-letter -3 --stdout HEAD >expect &&
+ git format-patch --cover-letter -3 --output=outfile HEAD &&
+ test_cmp expect outfile
+'
+
test_expect_success 'format-patch --base' '
git checkout patchid &&
diff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh
index 9d07797..9675bc1 100755
--- a/t/t4018-diff-funcname.sh
+++ b/t/t4018-diff-funcname.sh
@@ -27,6 +27,7 @@ test_expect_success 'setup' '
diffpatterns="
ada
+ bash
bibtex
cpp
csharp
diff --git a/t/t4018/bash-arithmetic-function b/t/t4018/bash-arithmetic-function
new file mode 100644
index 0000000..c0b276c
--- /dev/null
+++ b/t/t4018/bash-arithmetic-function
@@ -0,0 +1,4 @@
+RIGHT() ((
+
+ ChangeMe = "$x" + "$y"
+))
diff --git a/t/t4018/bash-bashism-style-compact b/t/t4018/bash-bashism-style-compact
new file mode 100644
index 0000000..1ca3126
--- /dev/null
+++ b/t/t4018/bash-bashism-style-compact
@@ -0,0 +1,6 @@
+function RIGHT {
+ function InvalidSyntax{
+ :
+ echo 'ChangeMe'
+ }
+}
diff --git a/t/t4018/bash-bashism-style-function b/t/t4018/bash-bashism-style-function
new file mode 100644
index 0000000..f1de4fa
--- /dev/null
+++ b/t/t4018/bash-bashism-style-function
@@ -0,0 +1,4 @@
+function RIGHT {
+ :
+ echo 'ChangeMe'
+}
diff --git a/t/t4018/bash-bashism-style-whitespace b/t/t4018/bash-bashism-style-whitespace
new file mode 100644
index 0000000..ade85dd
--- /dev/null
+++ b/t/t4018/bash-bashism-style-whitespace
@@ -0,0 +1,4 @@
+ function RIGHT ( ) {
+
+ ChangeMe
+ }
diff --git a/t/t4018/bash-conditional-function b/t/t4018/bash-conditional-function
new file mode 100644
index 0000000..c5949e8
--- /dev/null
+++ b/t/t4018/bash-conditional-function
@@ -0,0 +1,4 @@
+RIGHT() [[ \
+
+ "$a" > "$ChangeMe"
+]]
diff --git a/t/t4018/bash-missing-parentheses b/t/t4018/bash-missing-parentheses
new file mode 100644
index 0000000..8c8a05d
--- /dev/null
+++ b/t/t4018/bash-missing-parentheses
@@ -0,0 +1,6 @@
+function RIGHT {
+ functionInvalidSyntax {
+ :
+ echo 'ChangeMe'
+ }
+}
diff --git a/t/t4018/bash-mixed-style-compact b/t/t4018/bash-mixed-style-compact
new file mode 100644
index 0000000..d9364cb
--- /dev/null
+++ b/t/t4018/bash-mixed-style-compact
@@ -0,0 +1,4 @@
+function RIGHT(){
+ :
+ echo 'ChangeMe'
+}
diff --git a/t/t4018/bash-mixed-style-function b/t/t4018/bash-mixed-style-function
new file mode 100644
index 0000000..555f9b2
--- /dev/null
+++ b/t/t4018/bash-mixed-style-function
@@ -0,0 +1,4 @@
+function RIGHT() {
+
+ ChangeMe
+}
diff --git a/t/t4018/bash-nested-functions b/t/t4018/bash-nested-functions
new file mode 100644
index 0000000..2c9237e
--- /dev/null
+++ b/t/t4018/bash-nested-functions
@@ -0,0 +1,6 @@
+outer() {
+ RIGHT() {
+ :
+ echo 'ChangeMe'
+ }
+}
diff --git a/t/t4018/bash-other-characters b/t/t4018/bash-other-characters
new file mode 100644
index 0000000..a3f390d
--- /dev/null
+++ b/t/t4018/bash-other-characters
@@ -0,0 +1,4 @@
+_RIGHT_0n() {
+
+ ChangeMe
+}
diff --git a/t/t4018/bash-posix-style-compact b/t/t4018/bash-posix-style-compact
new file mode 100644
index 0000000..045bd20
--- /dev/null
+++ b/t/t4018/bash-posix-style-compact
@@ -0,0 +1,4 @@
+RIGHT(){
+
+ ChangeMe
+}
diff --git a/t/t4018/bash-posix-style-function b/t/t4018/bash-posix-style-function
new file mode 100644
index 0000000..a4d1448
--- /dev/null
+++ b/t/t4018/bash-posix-style-function
@@ -0,0 +1,4 @@
+RIGHT() {
+
+ ChangeMe
+}
diff --git a/t/t4018/bash-posix-style-whitespace b/t/t4018/bash-posix-style-whitespace
new file mode 100644
index 0000000..4d984f0
--- /dev/null
+++ b/t/t4018/bash-posix-style-whitespace
@@ -0,0 +1,4 @@
+ RIGHT ( ) {
+
+ ChangeMe
+ }
diff --git a/t/t4018/bash-subshell-function b/t/t4018/bash-subshell-function
new file mode 100644
index 0000000..80baa09
--- /dev/null
+++ b/t/t4018/bash-subshell-function
@@ -0,0 +1,4 @@
+RIGHT() (
+
+ ChangeMe=2
+)
diff --git a/t/t4018/bash-trailing-comment b/t/t4018/bash-trailing-comment
new file mode 100644
index 0000000..f1edbed
--- /dev/null
+++ b/t/t4018/bash-trailing-comment
@@ -0,0 +1,4 @@
+RIGHT() { # Comment
+
+ ChangeMe
+}
diff --git a/t/t4018/css-attribute-value-selector b/t/t4018/css-attribute-value-selector
new file mode 100644
index 0000000..918256b
--- /dev/null
+++ b/t/t4018/css-attribute-value-selector
@@ -0,0 +1,4 @@
+[class*="RIGHT"] {
+ background : #000;
+ border : 10px ChangeMe #C6C6C6;
+}
diff --git a/t/t4018/css-block-level-@-statements b/t/t4018/css-block-level-@-statements
new file mode 100644
index 0000000..d6755f2
--- /dev/null
+++ b/t/t4018/css-block-level-@-statements
@@ -0,0 +1,10 @@
+@keyframes RIGHT {
+ from {
+ background : #000;
+ border : 10px ChangeMe #C6C6C6;
+ }
+ to {
+ background : #fff;
+ border : 10px solid #C6C6C6;
+ }
+}
diff --git a/t/t4018/css-class-selector b/t/t4018/css-class-selector
new file mode 100644
index 0000000..f790a00
--- /dev/null
+++ b/t/t4018/css-class-selector
@@ -0,0 +1,4 @@
+.RIGHT {
+ background : #000;
+ border : 10px ChangeMe #C6C6C6;
+}
diff --git a/t/t4018/css-id-selector b/t/t4018/css-id-selector
new file mode 100644
index 0000000..17c5111
--- /dev/null
+++ b/t/t4018/css-id-selector
@@ -0,0 +1,4 @@
+#RIGHT {
+ background : #000;
+ border : 10px ChangeMe #C6C6C6;
+}
diff --git a/t/t4018/css-root-selector b/t/t4018/css-root-selector
new file mode 100644
index 0000000..22b958e
--- /dev/null
+++ b/t/t4018/css-root-selector
@@ -0,0 +1,4 @@
+:RIGHT {
+ background : #000;
+ border : 10px ChangeMe #C6C6C6;
+}
diff --git a/t/t4018/php-abstract-method b/t/t4018/php-abstract-method
new file mode 100644
index 0000000..ce215df
--- /dev/null
+++ b/t/t4018/php-abstract-method
@@ -0,0 +1,7 @@
+abstract class Klass
+{
+ abstract public function RIGHT(): ?string
+ {
+ return 'ChangeMe';
+ }
+}
diff --git a/t/t4018/php-final-method b/t/t4018/php-final-method
new file mode 100644
index 0000000..537fb8a
--- /dev/null
+++ b/t/t4018/php-final-method
@@ -0,0 +1,7 @@
+class Klass
+{
+ final public function RIGHT(): string
+ {
+ return 'ChangeMe';
+ }
+}
diff --git a/t/t4018/rust-macro-rules b/t/t4018/rust-macro-rules
new file mode 100644
index 0000000..ec610c5
--- /dev/null
+++ b/t/t4018/rust-macro-rules
@@ -0,0 +1,6 @@
+macro_rules! RIGHT {
+ () => {
+ // a comment
+ let x = ChangeMe;
+ };
+}
diff --git a/t/t4068-diff-symmetric-merge-base.sh b/t/t4068-diff-symmetric-merge-base.sh
new file mode 100755
index 0000000..03487cc
--- /dev/null
+++ b/t/t4068-diff-symmetric-merge-base.sh
@@ -0,0 +1,193 @@
+#!/bin/sh
+
+test_description='behavior of diff with symmetric-diff setups and --merge-base'
+
+. ./test-lib.sh
+
+# build these situations:
+# - normal merge with one merge base (br1...b2r);
+# - criss-cross merge ie 2 merge bases (br1...master);
+# - disjoint subgraph (orphan branch, br3...master).
+#
+# B---E <-- master
+# / \ /
+# A X
+# \ / \
+# C---D--G <-- br1
+# \ /
+# ---F <-- br2
+#
+# H <-- br3
+#
+# We put files into a few commits so that we can verify the
+# output as well.
+
+test_expect_success setup '
+ git commit --allow-empty -m A &&
+ echo b >b &&
+ git add b &&
+ git commit -m B &&
+ git checkout -b br1 HEAD^ &&
+ echo c >c &&
+ git add c &&
+ git commit -m C &&
+ git tag commit-C &&
+ git merge -m D master &&
+ git tag commit-D &&
+ git checkout master &&
+ git merge -m E commit-C &&
+ git checkout -b br2 commit-C &&
+ echo f >f &&
+ git add f &&
+ git commit -m F &&
+ git checkout br1 &&
+ git merge -m G br2 &&
+ git checkout --orphan br3 &&
+ git commit -m H
+'
+
+test_expect_success 'diff with one merge base' '
+ git diff commit-D...br1 >tmp &&
+ tail -n 1 tmp >actual &&
+ echo +f >expect &&
+ test_cmp expect actual
+'
+
+# The output (in tmp) can have +b or +c depending
+# on which merge base (commit B or C) is picked.
+# It should have one of those two, which comes out
+# to seven lines.
+test_expect_success 'diff with two merge bases' '
+ git diff br1...master >tmp 2>err &&
+ test_line_count = 7 tmp &&
+ test_line_count = 1 err
+'
+
+test_expect_success 'diff with no merge bases' '
+ test_must_fail git diff br2...br3 2>err &&
+ test_i18ngrep "fatal: br2...br3: no merge base" err
+'
+
+test_expect_success 'diff with too many symmetric differences' '
+ test_must_fail git diff br1...master br2...br3 2>err &&
+ test_i18ngrep "usage" err
+'
+
+test_expect_success 'diff with symmetric difference and extraneous arg' '
+ test_must_fail git diff master br1...master 2>err &&
+ test_i18ngrep "usage" err
+'
+
+test_expect_success 'diff with two ranges' '
+ test_must_fail git diff master br1..master br2..br3 2>err &&
+ test_i18ngrep "usage" err
+'
+
+test_expect_success 'diff with ranges and extra arg' '
+ test_must_fail git diff master br1..master commit-D 2>err &&
+ test_i18ngrep "usage" err
+'
+
+test_expect_success 'diff --merge-base with no commits' '
+ test_must_fail git diff --merge-base
+'
+
+test_expect_success 'diff --merge-base with three commits' '
+ test_must_fail git diff --merge-base br1 br2 master 2>err &&
+ test_i18ngrep "usage" err
+'
+
+for cmd in diff-index diff
+do
+ test_expect_success "$cmd --merge-base with one commit" '
+ git checkout master &&
+ git $cmd commit-C >expect &&
+ git $cmd --merge-base br2 >actual &&
+ test_cmp expect actual
+ '
+
+ test_expect_success "$cmd --merge-base with one commit and unstaged changes" '
+ git checkout master &&
+ test_when_finished git reset --hard &&
+ echo unstaged >>c &&
+ git $cmd commit-C >expect &&
+ git $cmd --merge-base br2 >actual &&
+ test_cmp expect actual
+ '
+
+ test_expect_success "$cmd --merge-base with one commit and staged and unstaged changes" '
+ git checkout master &&
+ test_when_finished git reset --hard &&
+ echo staged >>c &&
+ git add c &&
+ echo unstaged >>c &&
+ git $cmd commit-C >expect &&
+ git $cmd --merge-base br2 >actual &&
+ test_cmp expect actual
+ '
+
+ test_expect_success "$cmd --merge-base --cached with one commit and staged and unstaged changes" '
+ git checkout master &&
+ test_when_finished git reset --hard &&
+ echo staged >>c &&
+ git add c &&
+ echo unstaged >>c &&
+ git $cmd --cached commit-C >expect &&
+ git $cmd --cached --merge-base br2 >actual &&
+ test_cmp expect actual
+ '
+
+ test_expect_success "$cmd --merge-base with non-commit" '
+ git checkout master &&
+ test_must_fail git $cmd --merge-base master^{tree} 2>err &&
+ test_i18ngrep "fatal: --merge-base only works with commits" err
+ '
+
+ test_expect_success "$cmd --merge-base with no merge bases and one commit" '
+ git checkout master &&
+ test_must_fail git $cmd --merge-base br3 2>err &&
+ test_i18ngrep "fatal: no merge base found" err
+ '
+
+ test_expect_success "$cmd --merge-base with multiple merge bases and one commit" '
+ git checkout master &&
+ test_must_fail git $cmd --merge-base br1 2>err &&
+ test_i18ngrep "fatal: multiple merge bases found" err
+ '
+done
+
+for cmd in diff-tree diff
+do
+ test_expect_success "$cmd --merge-base with two commits" '
+ git $cmd commit-C master >expect &&
+ git $cmd --merge-base br2 master >actual &&
+ test_cmp expect actual
+ '
+
+ test_expect_success "$cmd --merge-base commit and non-commit" '
+ test_must_fail git $cmd --merge-base br2 master^{tree} 2>err &&
+ test_i18ngrep "fatal: --merge-base only works with commits" err
+ '
+
+ test_expect_success "$cmd --merge-base with no merge bases and two commits" '
+ test_must_fail git $cmd --merge-base br2 br3 2>err &&
+ test_i18ngrep "fatal: no merge base found" err
+ '
+
+ test_expect_success "$cmd --merge-base with multiple merge bases and two commits" '
+ test_must_fail git $cmd --merge-base master br1 2>err &&
+ test_i18ngrep "fatal: multiple merge bases found" err
+ '
+done
+
+test_expect_success 'diff-tree --merge-base with one commit' '
+ test_must_fail git diff-tree --merge-base master 2>err &&
+ test_i18ngrep "fatal: --merge-base only works with two commits" err
+'
+
+test_expect_success 'diff --merge-base with range' '
+ test_must_fail git diff --merge-base br2..br3 2>err &&
+ test_i18ngrep "fatal: --merge-base does not work with ranges" err
+'
+
+test_done
diff --git a/t/t4068-diff-symmetric.sh b/t/t4068-diff-symmetric.sh
deleted file mode 100755
index 31d17a5..0000000
--- a/t/t4068-diff-symmetric.sh
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/bin/sh
-
-test_description='behavior of diff with symmetric-diff setups'
-
-. ./test-lib.sh
-
-# build these situations:
-# - normal merge with one merge base (br1...b2r);
-# - criss-cross merge ie 2 merge bases (br1...master);
-# - disjoint subgraph (orphan branch, br3...master).
-#
-# B---E <-- master
-# / \ /
-# A X
-# \ / \
-# C---D--G <-- br1
-# \ /
-# ---F <-- br2
-#
-# H <-- br3
-#
-# We put files into a few commits so that we can verify the
-# output as well.
-
-test_expect_success setup '
- git commit --allow-empty -m A &&
- echo b >b &&
- git add b &&
- git commit -m B &&
- git checkout -b br1 HEAD^ &&
- echo c >c &&
- git add c &&
- git commit -m C &&
- git tag commit-C &&
- git merge -m D master &&
- git tag commit-D &&
- git checkout master &&
- git merge -m E commit-C &&
- git checkout -b br2 commit-C &&
- echo f >f &&
- git add f &&
- git commit -m F &&
- git checkout br1 &&
- git merge -m G br2 &&
- git checkout --orphan br3 &&
- git commit -m H
-'
-
-test_expect_success 'diff with one merge base' '
- git diff commit-D...br1 >tmp &&
- tail -n 1 tmp >actual &&
- echo +f >expect &&
- test_cmp expect actual
-'
-
-# The output (in tmp) can have +b or +c depending
-# on which merge base (commit B or C) is picked.
-# It should have one of those two, which comes out
-# to seven lines.
-test_expect_success 'diff with two merge bases' '
- git diff br1...master >tmp 2>err &&
- test_line_count = 7 tmp &&
- test_line_count = 1 err
-'
-
-test_expect_success 'diff with no merge bases' '
- test_must_fail git diff br2...br3 >tmp 2>err &&
- test_i18ngrep "fatal: br2...br3: no merge base" err
-'
-
-test_expect_success 'diff with too many symmetric differences' '
- test_must_fail git diff br1...master br2...br3 >tmp 2>err &&
- test_i18ngrep "usage" err
-'
-
-test_expect_success 'diff with symmetric difference and extraneous arg' '
- test_must_fail git diff master br1...master >tmp 2>err &&
- test_i18ngrep "usage" err
-'
-
-test_expect_success 'diff with two ranges' '
- test_must_fail git diff master br1..master br2..br3 >tmp 2>err &&
- test_i18ngrep "usage" err
-'
-
-test_expect_success 'diff with ranges and extra arg' '
- test_must_fail git diff master br1..master commit-D >tmp 2>err &&
- test_i18ngrep "usage" err
-'
-
-test_done
diff --git a/t/t4114-apply-typechange.sh b/t/t4114-apply-typechange.sh
index ebadbc3..da3e64f 100755
--- a/t/t4114-apply-typechange.sh
+++ b/t/t4114-apply-typechange.sh
@@ -88,6 +88,13 @@ test_expect_success 'symlink becomes file' '
'
test_debug 'cat patch'
+test_expect_success 'symlink becomes file, in reverse' '
+ git checkout -f foo-symlinked-to-bar &&
+ git diff-tree -p HEAD foo-back-to-file > patch &&
+ git checkout foo-back-to-file &&
+ git apply -R --index < patch
+ '
+
test_expect_success 'binary file becomes symlink' '
git checkout -f foo-becomes-binary &&
git diff-tree -p --binary HEAD foo-symlinked-to-bar > patch &&
diff --git a/t/t4127-apply-same-fn.sh b/t/t4127-apply-same-fn.sh
index 972946c..305b7e6 100755
--- a/t/t4127-apply-same-fn.sh
+++ b/t/t4127-apply-same-fn.sh
@@ -32,6 +32,10 @@ test_expect_success 'apply same filename with independent changes' '
test_expect_success 'apply same filename with overlapping changes' '
git reset --hard &&
+
+ # Store same_fn so that we can check apply -R in next test
+ cp same_fn same_fn1 &&
+
modify "s/^d/z/" same_fn &&
git diff > patch0 &&
git add same_fn &&
@@ -43,6 +47,11 @@ test_expect_success 'apply same filename with overlapping changes' '
test_cmp same_fn same_fn2
'
+test_expect_success 'apply same filename with overlapping changes, in reverse' '
+ git apply -R patch0 &&
+ test_cmp same_fn same_fn1
+'
+
test_expect_success 'apply same new filename after rename' '
git reset --hard &&
git mv same_fn new_fn &&
diff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh
index 2d1d7b5..85d1514 100755
--- a/t/t4211-line-log.sh
+++ b/t/t4211-line-log.sh
@@ -8,6 +8,28 @@ test_expect_success 'setup (import history)' '
git reset --hard
'
+test_expect_success 'basic command line parsing' '
+ # This may fail due to "no such path a.c in commit", or
+ # "-L is incompatible with pathspec", depending on the
+ # order the error is checked. Either is acceptable.
+ test_must_fail git log -L1,1:a.c -- a.c &&
+
+ # -L requires there is no pathspec
+ test_must_fail git log -L1,1:b.c -- b.c 2>error &&
+ test_i18ngrep "cannot be used with pathspec" error &&
+
+ # This would fail because --follow wants a single path, but
+ # we may fail due to incompatibility between -L/--follow in
+ # the future. Either is acceptable.
+ test_must_fail git log -L1,1:b.c --follow &&
+ test_must_fail git log --follow -L1,1:b.c &&
+
+ # This would fail because -L wants no pathspec, but
+ # we may fail due to incompatibility between -L/--follow in
+ # the future. Either is acceptable.
+ test_must_fail git log --follow -L1,1:b.c -- b.c
+'
+
canned_test_1 () {
test_expect_$1 "$2" "
git log $2 >actual &&
diff --git a/t/t5315-pack-objects-compression.sh b/t/t5315-pack-objects-compression.sh
index df970d7..8bacd96 100755
--- a/t/t5315-pack-objects-compression.sh
+++ b/t/t5315-pack-objects-compression.sh
@@ -4,12 +4,6 @@ test_description='pack-object compression configuration'
. ./test-lib.sh
-# This should be moved to test-lib.sh together with the
-# copy in t0021 after both topics have graduated to 'master'.
-file_size () {
- test-tool path-utils file-size "$1"
-}
-
test_expect_success setup '
printf "%2000000s" X |
git hash-object -w --stdin >object-name &&
@@ -24,7 +18,7 @@ do
test_expect_success "pack-objects with $config" '
test_when_finished "rm -f pack-*.*" &&
git $config pack-objects pack <object-name &&
- sz=$(file_size pack-*.pack) &&
+ sz=$(test_file_size pack-*.pack) &&
case "$expect" in
small) test "$sz" -le 100000 ;;
large) test "$sz" -ge 100000 ;;
diff --git a/t/t5319-multi-pack-index.sh b/t/t5319-multi-pack-index.sh
index f340b37..ace469c 100755
--- a/t/t5319-multi-pack-index.sh
+++ b/t/t5319-multi-pack-index.sh
@@ -3,6 +3,7 @@
test_description='multi-pack-indexes'
. ./test-lib.sh
+GIT_TEST_MULTI_PACK_INDEX=0
objdir=.git/objects
HASH_LEN=$(test_oid rawsz)
@@ -173,12 +174,12 @@ test_expect_success 'write progress off for redirected stderr' '
'
test_expect_success 'write force progress on for stderr' '
- git multi-pack-index --object-dir=$objdir --progress write 2>err &&
+ GIT_PROGRESS_DELAY=0 git multi-pack-index --object-dir=$objdir --progress write 2>err &&
test_file_not_empty err
'
test_expect_success 'write with the --no-progress option' '
- git multi-pack-index --object-dir=$objdir --no-progress write 2>err &&
+ GIT_PROGRESS_DELAY=0 git multi-pack-index --object-dir=$objdir --no-progress write 2>err &&
test_line_count = 0 err
'
@@ -368,17 +369,17 @@ test_expect_success 'git-fsck incorrect offset' '
'
test_expect_success 'repack progress off for redirected stderr' '
- git multi-pack-index --object-dir=$objdir repack 2>err &&
+ GIT_PROGRESS_DELAY=0 git multi-pack-index --object-dir=$objdir repack 2>err &&
test_line_count = 0 err
'
test_expect_success 'repack force progress on for stderr' '
- git multi-pack-index --object-dir=$objdir --progress repack 2>err &&
+ GIT_PROGRESS_DELAY=0 git multi-pack-index --object-dir=$objdir --progress repack 2>err &&
test_file_not_empty err
'
test_expect_success 'repack with the --no-progress option' '
- git multi-pack-index --object-dir=$objdir --no-progress repack 2>err &&
+ GIT_PROGRESS_DELAY=0 git multi-pack-index --object-dir=$objdir --no-progress repack 2>err &&
test_line_count = 0 err
'
@@ -562,7 +563,7 @@ test_expect_success 'expire progress off for redirected stderr' '
test_expect_success 'expire force progress on for stderr' '
(
cd dup &&
- git multi-pack-index --progress expire 2>err &&
+ GIT_PROGRESS_DELAY=0 git multi-pack-index --progress expire 2>err &&
test_file_not_empty err
)
'
@@ -570,7 +571,7 @@ test_expect_success 'expire force progress on for stderr' '
test_expect_success 'expire with the --no-progress option' '
(
cd dup &&
- git multi-pack-index --no-progress expire 2>err &&
+ GIT_PROGRESS_DELAY=0 git multi-pack-index --no-progress expire 2>err &&
test_line_count = 0 err
)
'
diff --git a/t/t5324-split-commit-graph.sh b/t/t5324-split-commit-graph.sh
index c334ee9..4d3842b 100755
--- a/t/t5324-split-commit-graph.sh
+++ b/t/t5324-split-commit-graph.sh
@@ -440,4 +440,17 @@ test_expect_success '--split=replace with partial Bloom data' '
verify_chain_files_exist $graphdir
'
+test_expect_success 'prevent regression for duplicate commits across layers' '
+ git init dup &&
+ git -C dup commit --allow-empty -m one &&
+ git -C dup -c core.commitGraph=false commit-graph write --split=no-merge --reachable 2>err &&
+ test_i18ngrep "attempting to write a commit-graph" err &&
+ git -C dup commit-graph write --split=no-merge --reachable &&
+ git -C dup commit --allow-empty -m two &&
+ git -C dup commit-graph write --split=no-merge --reachable &&
+ git -C dup commit --allow-empty -m three &&
+ git -C dup commit-graph write --split --reachable &&
+ git -C dup commit-graph verify
+'
+
test_done
diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh
index b84618c..cc86ef2 100755
--- a/t/t5400-send-pack.sh
+++ b/t/t5400-send-pack.sh
@@ -21,14 +21,15 @@ test_expect_success setup '
i=0 &&
while test $i -le $cnt
do
- i=$(($i+1)) &&
- test_tick &&
- echo "Commit #$i" >mozart/is/pink &&
- git update-index --add mozart/is/pink &&
- tree=$(git write-tree) &&
- commit=$(echo "Commit #$i" | git commit-tree $tree -p $parent) &&
- git update-ref refs/tags/commit$i $commit &&
- parent=$commit || return 1
+ i=$(($i+1)) &&
+ test_tick &&
+ echo "Commit #$i" >mozart/is/pink &&
+ git update-index --add mozart/is/pink &&
+ tree=$(git write-tree) &&
+ commit=$(echo "Commit #$i" |
+ git commit-tree $tree -p $parent) &&
+ git update-ref refs/tags/commit$i $commit &&
+ parent=$commit || return 1
done &&
git update-ref HEAD "$commit" &&
git clone ./. victim &&
@@ -38,14 +39,14 @@ test_expect_success setup '
i=0 &&
while test $i -le $cnt
do
- i=$(($i+1)) &&
- test_tick &&
- echo "Rebase #$i" >mozart/is/pink &&
- git update-index --add mozart/is/pink &&
- tree=$(git write-tree) &&
- commit=$(echo "Rebase #$i" | git commit-tree $tree -p $parent) &&
- git update-ref refs/tags/rebase$i $commit &&
- parent=$commit || return 1
+ i=$(($i+1)) &&
+ test_tick &&
+ echo "Rebase #$i" >mozart/is/pink &&
+ git update-index --add mozart/is/pink &&
+ tree=$(git write-tree) &&
+ commit=$(echo "Rebase #$i" | git commit-tree $tree -p $parent) &&
+ git update-ref refs/tags/rebase$i $commit &&
+ parent=$commit || return 1
done &&
git update-ref HEAD "$commit" &&
echo Rebase &&
@@ -57,11 +58,11 @@ test_expect_success 'pack the source repository' '
'
test_expect_success 'pack the destination repository' '
- (
- cd victim &&
- git repack -a -d &&
- git prune
- )
+ (
+ cd victim &&
+ git repack -a -d &&
+ git prune
+ )
'
test_expect_success 'refuse pushing rewound head without --force' '
@@ -85,10 +86,10 @@ test_expect_success 'push can be used to delete a ref' '
test_expect_success 'refuse deleting push with denyDeletes' '
(
- cd victim &&
- test_might_fail git branch -D extra &&
- git config receive.denyDeletes true &&
- git branch extra master
+ cd victim &&
+ test_might_fail git branch -D extra &&
+ git config receive.denyDeletes true &&
+ git branch extra master
) &&
test_must_fail git send-pack ./victim :extra master
'
@@ -118,9 +119,9 @@ test_expect_success 'override denyDeletes with git -c receive-pack' '
test_expect_success 'denyNonFastforwards trumps --force' '
(
- cd victim &&
- test_might_fail git branch -D extra &&
- git config receive.denyNonFastforwards true
+ cd victim &&
+ test_might_fail git branch -D extra &&
+ git config receive.denyNonFastforwards true
) &&
victim_orig=$(cd victim && git rev-parse --verify master) &&
test_must_fail git send-pack --force ./victim master^:master &&
@@ -143,16 +144,16 @@ test_expect_success 'send-pack --all sends all branches' '
test_expect_success 'push --all excludes remote-tracking hierarchy' '
mkdir parent &&
(
- cd parent &&
- git init && : >file && git add file && git commit -m add
+ cd parent &&
+ git init && : >file && git add file && git commit -m add
) &&
git clone parent child &&
(
- cd child && git push --all
+ cd child && git push --all
) &&
(
- cd parent &&
- test -z "$(git for-each-ref refs/remotes/origin)"
+ cd parent &&
+ test -z "$(git for-each-ref refs/remotes/origin)"
)
'
@@ -160,33 +161,33 @@ test_expect_success 'receive-pack runs auto-gc in remote repo' '
rm -rf parent child &&
git init parent &&
(
- # Setup a repo with 2 packs
- cd parent &&
- echo "Some text" >file.txt &&
- git add . &&
- git commit -m "Initial commit" &&
- git repack -adl &&
- echo "Some more text" >>file.txt &&
- git commit -a -m "Second commit" &&
- git repack
+ # Setup a repo with 2 packs
+ cd parent &&
+ echo "Some text" >file.txt &&
+ git add . &&
+ git commit -m "Initial commit" &&
+ git repack -adl &&
+ echo "Some more text" >>file.txt &&
+ git commit -a -m "Second commit" &&
+ git repack
) &&
cp -R parent child &&
(
- # Set the child to auto-pack if more than one pack exists
- cd child &&
- git config gc.autopacklimit 1 &&
- git config gc.autodetach false &&
- git branch test_auto_gc &&
- # And create a file that follows the temporary object naming
- # convention for the auto-gc to remove
- : >.git/objects/tmp_test_object &&
- test-tool chmtime =-1209601 .git/objects/tmp_test_object
+ # Set the child to auto-pack if more than one pack exists
+ cd child &&
+ git config gc.autopacklimit 1 &&
+ git config gc.autodetach false &&
+ git branch test_auto_gc &&
+ # And create a file that follows the temporary object naming
+ # convention for the auto-gc to remove
+ : >.git/objects/tmp_test_object &&
+ test-tool chmtime =-1209601 .git/objects/tmp_test_object
) &&
(
- cd parent &&
- echo "Even more text" >>file.txt &&
- git commit -a -m "Third commit" &&
- git send-pack ../child HEAD:refs/heads/test_auto_gc
+ cd parent &&
+ echo "Even more text" >>file.txt &&
+ git commit -a -m "Third commit" &&
+ git send-pack ../child HEAD:refs/heads/test_auto_gc
) &&
test ! -e child/.git/objects/tmp_test_object
'
@@ -195,15 +196,15 @@ rewound_push_setup() {
rm -rf parent child &&
mkdir parent &&
(
- cd parent &&
- git init &&
- echo one >file && git add file && git commit -m one &&
- git config receive.denyCurrentBranch warn &&
- echo two >file && git commit -a -m two
+ cd parent &&
+ git init &&
+ echo one >file && git add file && git commit -m one &&
+ git config receive.denyCurrentBranch warn &&
+ echo two >file && git commit -a -m two
) &&
git clone parent child &&
(
- cd child && git reset --hard HEAD^
+ cd child && git reset --hard HEAD^
)
}
@@ -211,16 +212,16 @@ test_expect_success 'pushing explicit refspecs respects forcing' '
rewound_push_setup &&
parent_orig=$(cd parent && git rev-parse --verify master) &&
(
- cd child &&
- test_must_fail git send-pack ../parent \
- refs/heads/master:refs/heads/master
+ cd child &&
+ test_must_fail git send-pack ../parent \
+ refs/heads/master:refs/heads/master
) &&
parent_head=$(cd parent && git rev-parse --verify master) &&
test "$parent_orig" = "$parent_head" &&
(
- cd child &&
- git send-pack ../parent \
- +refs/heads/master:refs/heads/master
+ cd child &&
+ git send-pack ../parent \
+ +refs/heads/master:refs/heads/master
) &&
parent_head=$(cd parent && git rev-parse --verify master) &&
child_head=$(cd child && git rev-parse --verify master) &&
@@ -231,16 +232,16 @@ test_expect_success 'pushing wildcard refspecs respects forcing' '
rewound_push_setup &&
parent_orig=$(cd parent && git rev-parse --verify master) &&
(
- cd child &&
- test_must_fail git send-pack ../parent \
- "refs/heads/*:refs/heads/*"
+ cd child &&
+ test_must_fail git send-pack ../parent \
+ "refs/heads/*:refs/heads/*"
) &&
parent_head=$(cd parent && git rev-parse --verify master) &&
test "$parent_orig" = "$parent_head" &&
(
- cd child &&
- git send-pack ../parent \
- "+refs/heads/*:refs/heads/*"
+ cd child &&
+ git send-pack ../parent \
+ "+refs/heads/*:refs/heads/*"
) &&
parent_head=$(cd parent && git rev-parse --verify master) &&
child_head=$(cd child && git rev-parse --verify master) &&
@@ -250,8 +251,8 @@ test_expect_success 'pushing wildcard refspecs respects forcing' '
test_expect_success 'deny pushing to delete current branch' '
rewound_push_setup &&
(
- cd child &&
- test_must_fail git send-pack ../parent :refs/heads/master 2>errs
+ cd child &&
+ test_must_fail git send-pack ../parent :refs/heads/master 2>errs
)
'
@@ -289,7 +290,7 @@ test_expect_success 'receive-pack de-dupes .have lines' '
EOF
GIT_TRACE_PACKET=$(pwd)/trace GIT_TEST_PROTOCOL_VERSION=0 \
- git push \
+ git push \
--receive-pack="unset GIT_TRACE_PACKET; git-receive-pack" \
fork HEAD:foo &&
extract_ref_advertisement <trace >refs &&
diff --git a/t/t5402-post-merge-hook.sh b/t/t5402-post-merge-hook.sh
index 6eb2ffd..4aeea8f 100755
--- a/t/t5402-post-merge-hook.sh
+++ b/t/t5402-post-merge-hook.sh
@@ -15,7 +15,7 @@ test_expect_success setup '
git update-index a &&
tree1=$(git write-tree) &&
commit1=$(echo modify | git commit-tree $tree1 -p $commit0) &&
- git update-ref refs/heads/master $commit0 &&
+ git update-ref refs/heads/master $commit0 &&
git clone ./. clone1 &&
GIT_DIR=clone1/.git git update-index --add a &&
git clone ./. clone2 &&
@@ -23,34 +23,34 @@ test_expect_success setup '
'
for clone in 1 2; do
- cat >clone${clone}/.git/hooks/post-merge <<'EOF'
+ cat >clone${clone}/.git/hooks/post-merge <<'EOF'
#!/bin/sh
echo $@ >> $GIT_DIR/post-merge.args
EOF
- chmod u+x clone${clone}/.git/hooks/post-merge
+ chmod u+x clone${clone}/.git/hooks/post-merge
done
test_expect_success 'post-merge does not run for up-to-date ' '
- GIT_DIR=clone1/.git git merge $commit0 &&
+ GIT_DIR=clone1/.git git merge $commit0 &&
! test -f clone1/.git/post-merge.args
'
test_expect_success 'post-merge runs as expected ' '
- GIT_DIR=clone1/.git git merge $commit1 &&
+ GIT_DIR=clone1/.git git merge $commit1 &&
test -e clone1/.git/post-merge.args
'
test_expect_success 'post-merge from normal merge receives the right argument ' '
- grep 0 clone1/.git/post-merge.args
+ grep 0 clone1/.git/post-merge.args
'
test_expect_success 'post-merge from squash merge runs as expected ' '
- GIT_DIR=clone2/.git git merge --squash $commit1 &&
+ GIT_DIR=clone2/.git git merge --squash $commit1 &&
test -e clone2/.git/post-merge.args
'
test_expect_success 'post-merge from squash merge receives the right argument ' '
- grep 1 clone2/.git/post-merge.args
+ grep 1 clone2/.git/post-merge.args
'
test_done
diff --git a/t/t5411-proc-receive-hook.sh b/t/t5411-proc-receive-hook.sh
index 7464872..98b0e81 100755
--- a/t/t5411-proc-receive-hook.sh
+++ b/t/t5411-proc-receive-hook.sh
@@ -5,13 +5,16 @@
test_description='Test proc-receive hook'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
. ./test-lib.sh
. "$TEST_DIRECTORY"/t5411/common-functions.sh
setup_upstream_and_workbench () {
- # Refs of upstream : master(A)
- # Refs of workbench: master(A) tags/v123
+ # Refs of upstream : main(A)
+ # Refs of workbench: main(A) tags/v123
test_expect_success "setup upstream and workbench" '
rm -rf upstream.git &&
rm -rf workbench &&
@@ -25,10 +28,10 @@ setup_upstream_and_workbench () {
git config core.abbrev 7 &&
git tag -m "v123" v123 $A &&
git remote add origin ../upstream.git &&
- git push origin master &&
- git update-ref refs/heads/master $A $B &&
+ git push origin main &&
+ git update-ref refs/heads/main $A $B &&
git -C ../upstream.git update-ref \
- refs/heads/master $A $B
+ refs/heads/main $A $B
) &&
TAG=$(git -C workbench rev-parse v123) &&
@@ -99,8 +102,8 @@ start_httpd
# Re-initialize the upstream repository and local workbench.
setup_upstream_and_workbench
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
test_expect_success "setup for HTTP protocol" '
git -C upstream.git config http.receivepack true &&
upstream="$HTTPD_DOCUMENT_ROOT_PATH/upstream.git" &&
diff --git a/t/t5411/common-functions.sh b/t/t5411/common-functions.sh
index 6580beb..521a347 100644
--- a/t/t5411/common-functions.sh
+++ b/t/t5411/common-functions.sh
@@ -28,7 +28,7 @@ create_commits_in () {
shift ||
return 1
done &&
- git -C "$repo" update-ref refs/heads/master $oid
+ git -C "$repo" update-ref refs/heads/main $oid
}
# Format the output of git-push, git-show-ref and other commands to make a
diff --git a/t/t5411/once-0010-report-status-v1.sh b/t/t5411/once-0010-report-status-v1.sh
index dc2cf4a..cb431a9 100644
--- a/t/t5411/once-0010-report-status-v1.sh
+++ b/t/t5411/once-0010-report-status-v1.sh
@@ -6,12 +6,12 @@ test_expect_success "setup proc-receive hook" '
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic1" \
+ -r "ok refs/for/main/topic1" \
-r "option fall-through" \
- -r "ok refs/for/master/topic2" \
+ -r "ok refs/for/main/topic2" \
-r "option refname refs/for/changes/23/123/1" \
-r "option new-oid $A" \
- -r "ok refs/for/master/topic2" \
+ -r "ok refs/for/main/topic2" \
-r "option refname refs/for/changes/24/124/2" \
-r "option old-oid $B" \
-r "option new-oid $A" \
@@ -20,26 +20,26 @@ test_expect_success "setup proc-receive hook" '
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : (B) refs/for/master/topic1(A) foo(A) refs/for/next/topic(A) refs/for/master/topic2(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : (B) refs/for/main/topic1(A) foo(A) refs/for/next/topic(A) refs/for/main/topic2(A)
test_expect_success "proc-receive: report status v1" '
{
if test -z "$GIT_DEFAULT_HASH" || test "$GIT_DEFAULT_HASH" = "sha1"
then
- printf "%s %s refs/heads/master\0report-status\n" \
+ printf "%s %s refs/heads/main\0report-status\n" \
$A $B | packetize
else
- printf "%s %s refs/heads/master\0report-status object-format=$GIT_DEFAULT_HASH\n" \
+ printf "%s %s refs/heads/main\0report-status object-format=$GIT_DEFAULT_HASH\n" \
$A $B | packetize
fi &&
- printf "%s %s refs/for/master/topic1\n" \
+ printf "%s %s refs/for/main/topic1\n" \
$ZERO_OID $A | packetize &&
printf "%s %s refs/heads/foo\n" \
$ZERO_OID $A | packetize &&
printf "%s %s refs/for/next/topic\n" \
$ZERO_OID $A | packetize &&
- printf "%s %s refs/for/master/topic2\n" \
+ printf "%s %s refs/for/main/topic2\n" \
$ZERO_OID $A | packetize &&
printf 0000 &&
printf "" | git -C "$upstream" pack-objects --stdout
@@ -48,35 +48,35 @@ test_expect_success "proc-receive: report status v1" '
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
# pre-receive hook
- pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
- pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic1
+ pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
+ pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic1
pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo
pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
- pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic2
+ pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic2
# proc-receive hook
- proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic1
+ proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic1
proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
- proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic2
- proc-receive> ok refs/for/master/topic1
+ proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic2
+ proc-receive> ok refs/for/main/topic1
proc-receive> option fall-through
- proc-receive> ok refs/for/master/topic2
+ proc-receive> ok refs/for/main/topic2
proc-receive> option refname refs/for/changes/23/123/1
proc-receive> option new-oid <COMMIT-A>
- proc-receive> ok refs/for/master/topic2
+ proc-receive> ok refs/for/main/topic2
proc-receive> option refname refs/for/changes/24/124/2
proc-receive> option old-oid <COMMIT-B>
proc-receive> option new-oid <COMMIT-A>
proc-receive> option forced-update
proc-receive> ng refs/for/next/topic target branch not exist
000eunpack ok
- 0019ok refs/heads/master
- 001eok refs/for/master/topic1
+ 0017ok refs/heads/main
+ 001cok refs/for/main/topic1
0016ok refs/heads/foo
0033ng refs/for/next/topic target branch not exist
- 001eok refs/for/master/topic2
+ 001cok refs/for/main/topic2
0000# post-receive hook
- post-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
- post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic1
+ post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
+ post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic1
post-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo
post-receive< <ZERO-OID> <COMMIT-A> refs/for/changes/23/123/1
post-receive< <COMMIT-B> <COMMIT-A> refs/for/changes/24/124/2
@@ -86,9 +86,9 @@ test_expect_success "proc-receive: report status v1" '
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/for/master/topic1
+ <COMMIT-A> refs/for/main/topic1
<COMMIT-A> refs/heads/foo
- <COMMIT-B> refs/heads/master
+ <COMMIT-B> refs/heads/main
EOF
test_cmp expect actual
'
diff --git a/t/t5411/test-0000-standard-git-push.sh b/t/t5411/test-0000-standard-git-push.sh
index e206587..2b04b49 100644
--- a/t/t5411/test-0000-standard-git-push.sh
+++ b/t/t5411/test-0000-standard-git-push.sh
@@ -1,39 +1,39 @@
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git-push : master(B) next(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git-push : main(B) next(A)
test_expect_success "git-push ($PROTOCOL)" '
git -C workbench push origin \
- $B:refs/heads/master \
+ $B:refs/heads/main \
HEAD:refs/heads/next \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+ remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
remote: # post-receive hook
- remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
To <URL/of/upstream.git>
- <OID-A>..<OID-B> <COMMIT-B> -> master
+ <OID-A>..<OID-B> <COMMIT-B> -> main
* [new branch] HEAD -> next
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-B> refs/heads/master
+ <COMMIT-B> refs/heads/main
<COMMIT-A> refs/heads/next
EOF
test_cmp expect actual
'
-# Refs of upstream : master(B) next(A)
-# Refs of workbench: master(A) tags/v123
-# git-push --atomic: master(A) next(B)
+# Refs of upstream : main(B) next(A)
+# Refs of workbench: main(A) tags/v123
+# git-push --atomic: main(A) next(B)
test_expect_success "git-push --atomic ($PROTOCOL)" '
test_must_fail git -C workbench push --atomic origin \
- master \
+ main \
$B:refs/heads/next \
>out 2>&1 &&
make_user_friendly_and_stable_output <out |
@@ -43,28 +43,28 @@ test_expect_success "git-push --atomic ($PROTOCOL)" '
>actual &&
cat >expect <<-EOF &&
To <URL/of/upstream.git>
- ! [rejected] master -> master (non-fast-forward)
+ ! [rejected] main -> main (non-fast-forward)
! [rejected] <COMMIT-B> -> next (atomic push failed)
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-B> refs/heads/master
+ <COMMIT-B> refs/heads/main
<COMMIT-A> refs/heads/next
EOF
test_cmp expect actual
'
-# Refs of upstream : master(B) next(A)
-# Refs of workbench: master(A) tags/v123
-# git-push : master(A) next(B)
+# Refs of upstream : main(B) next(A)
+# Refs of workbench: main(A) tags/v123
+# git-push : main(A) next(B)
test_expect_success "non-fast-forward git-push ($PROTOCOL)" '
test_must_fail git \
-C workbench \
-c advice.pushUpdateRejected=false \
push origin \
- master \
+ main \
$B:refs/heads/next \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
@@ -75,48 +75,48 @@ test_expect_success "non-fast-forward git-push ($PROTOCOL)" '
remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/next
To <URL/of/upstream.git>
<OID-A>..<OID-B> <COMMIT-B> -> next
- ! [rejected] master -> master (non-fast-forward)
+ ! [rejected] main -> main (non-fast-forward)
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-B> refs/heads/master
+ <COMMIT-B> refs/heads/main
<COMMIT-B> refs/heads/next
EOF
test_cmp expect actual
'
-# Refs of upstream : master(B) next(B)
-# Refs of workbench: master(A) tags/v123
-# git-push -f : master(A) NULL tags/v123 refs/review/master/topic(A) a/b/c(A)
+# Refs of upstream : main(B) next(B)
+# Refs of workbench: main(A) tags/v123
+# git-push -f : main(A) NULL tags/v123 refs/review/main/topic(A) a/b/c(A)
test_expect_success "git-push -f ($PROTOCOL)" '
git -C workbench push -f origin \
refs/tags/v123 \
:refs/heads/next \
- master \
- master:refs/review/master/topic \
+ main \
+ main:refs/review/main/topic \
HEAD:refs/heads/a/b/c \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/master
+ remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/main
remote: pre-receive< <COMMIT-B> <ZERO-OID> refs/heads/next
remote: pre-receive< <ZERO-OID> <TAG-v123> refs/tags/v123
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/review/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/review/main/topic
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/a/b/c
remote: # post-receive hook
- remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/master
+ remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/main
remote: post-receive< <COMMIT-B> <ZERO-OID> refs/heads/next
remote: post-receive< <ZERO-OID> <TAG-v123> refs/tags/v123
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/review/master/topic
+ remote: post-receive< <ZERO-OID> <COMMIT-A> refs/review/main/topic
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/a/b/c
To <URL/of/upstream.git>
- + <OID-B>...<OID-A> master -> master (forced update)
+ + <OID-B>...<OID-A> main -> main (forced update)
- [deleted] next
* [new tag] v123 -> v123
- * [new reference] master -> refs/review/master/topic
+ * [new reference] main -> refs/review/main/topic
* [new branch] HEAD -> a/b/c
EOF
test_cmp expect actual &&
@@ -124,19 +124,19 @@ test_expect_success "git-push -f ($PROTOCOL)" '
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
<COMMIT-A> refs/heads/a/b/c
- <COMMIT-A> refs/heads/master
- <COMMIT-A> refs/review/master/topic
+ <COMMIT-A> refs/heads/main
+ <COMMIT-A> refs/review/main/topic
<TAG-v123> refs/tags/v123
EOF
test_cmp expect actual
'
-# Refs of upstream : master(A) tags/v123 refs/review/master/topic(A) a/b/c(A)
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(A) tags/v123 refs/review/main/topic(A) a/b/c(A)
+# Refs of workbench: main(A) tags/v123
test_expect_success "cleanup ($PROTOCOL)" '
(
cd "$upstream" &&
- git update-ref -d refs/review/master/topic &&
+ git update-ref -d refs/review/main/topic &&
git update-ref -d refs/tags/v123 &&
git update-ref -d refs/heads/a/b/c
)
diff --git a/t/t5411/test-0001-standard-git-push--porcelain.sh b/t/t5411/test-0001-standard-git-push--porcelain.sh
index 48f6fcc..747307f 100644
--- a/t/t5411/test-0001-standard-git-push--porcelain.sh
+++ b/t/t5411/test-0001-standard-git-push--porcelain.sh
@@ -1,21 +1,21 @@
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git-push : master(B) next(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git-push : main(B) next(A)
test_expect_success "git-push ($PROTOCOL/porcelain)" '
git -C workbench push --porcelain origin \
- $B:refs/heads/master \
+ $B:refs/heads/main \
HEAD:refs/heads/next \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+ remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
remote: # post-receive hook
- remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
To <URL/of/upstream.git>
- <COMMIT-B>:refs/heads/master <OID-A>..<OID-B>
+ <COMMIT-B>:refs/heads/main <OID-A>..<OID-B>
* HEAD:refs/heads/next [new branch]
Done
EOF
@@ -23,18 +23,18 @@ test_expect_success "git-push ($PROTOCOL/porcelain)" '
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-B> refs/heads/master
+ <COMMIT-B> refs/heads/main
<COMMIT-A> refs/heads/next
EOF
test_cmp expect actual
'
-# Refs of upstream : master(B) next(A)
-# Refs of workbench: master(A) tags/v123
-# git-push --atomic: master(A) next(B)
+# Refs of upstream : main(B) next(A)
+# Refs of workbench: main(A) tags/v123
+# git-push --atomic: main(A) next(B)
test_expect_success "git-push --atomic ($PROTOCOL/porcelain)" '
test_must_fail git -C workbench push --atomic --porcelain origin \
- master \
+ main \
$B:refs/heads/next \
>out 2>&1 &&
make_user_friendly_and_stable_output <out |
@@ -45,28 +45,28 @@ test_expect_success "git-push --atomic ($PROTOCOL/porcelain)" '
>actual &&
cat >expect <<-EOF &&
To <URL/of/upstream.git>
- ! refs/heads/master:refs/heads/master [rejected] (non-fast-forward)
+ ! refs/heads/main:refs/heads/main [rejected] (non-fast-forward)
! <COMMIT-B>:refs/heads/next [rejected] (atomic push failed)
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-B> refs/heads/master
+ <COMMIT-B> refs/heads/main
<COMMIT-A> refs/heads/next
EOF
test_cmp expect actual
'
-# Refs of upstream : master(B) next(A)
-# Refs of workbench: master(A) tags/v123
-# git-push : master(A) next(B)
+# Refs of upstream : main(B) next(A)
+# Refs of workbench: main(A) tags/v123
+# git-push : main(A) next(B)
test_expect_success "non-fast-forward git-push ($PROTOCOL/porcelain)" '
test_must_fail git \
-C workbench \
-c advice.pushUpdateRejected=false \
push --porcelain origin \
- master \
+ main \
$B:refs/heads/next \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
@@ -77,49 +77,49 @@ test_expect_success "non-fast-forward git-push ($PROTOCOL/porcelain)" '
remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/next
To <URL/of/upstream.git>
<COMMIT-B>:refs/heads/next <OID-A>..<OID-B>
- ! refs/heads/master:refs/heads/master [rejected] (non-fast-forward)
+ ! refs/heads/main:refs/heads/main [rejected] (non-fast-forward)
Done
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-B> refs/heads/master
+ <COMMIT-B> refs/heads/main
<COMMIT-B> refs/heads/next
EOF
test_cmp expect actual
'
-# Refs of upstream : master(B) next(B)
-# Refs of workbench: master(A) tags/v123
-# git-push -f : master(A) NULL tags/v123 refs/review/master/topic(A) a/b/c(A)
+# Refs of upstream : main(B) next(B)
+# Refs of workbench: main(A) tags/v123
+# git-push -f : main(A) NULL tags/v123 refs/review/main/topic(A) a/b/c(A)
test_expect_success "git-push -f ($PROTOCOL/porcelain)" '
git -C workbench push --porcelain -f origin \
refs/tags/v123 \
:refs/heads/next \
- master \
- master:refs/review/master/topic \
+ main \
+ main:refs/review/main/topic \
HEAD:refs/heads/a/b/c \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/master
+ remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/main
remote: pre-receive< <COMMIT-B> <ZERO-OID> refs/heads/next
remote: pre-receive< <ZERO-OID> <TAG-v123> refs/tags/v123
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/review/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/review/main/topic
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/a/b/c
remote: # post-receive hook
- remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/master
+ remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/main
remote: post-receive< <COMMIT-B> <ZERO-OID> refs/heads/next
remote: post-receive< <ZERO-OID> <TAG-v123> refs/tags/v123
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/review/master/topic
+ remote: post-receive< <ZERO-OID> <COMMIT-A> refs/review/main/topic
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/a/b/c
To <URL/of/upstream.git>
- + refs/heads/master:refs/heads/master <OID-B>...<OID-A> (forced update)
+ + refs/heads/main:refs/heads/main <OID-B>...<OID-A> (forced update)
- :refs/heads/next [deleted]
* refs/tags/v123:refs/tags/v123 [new tag]
- * refs/heads/master:refs/review/master/topic [new reference]
+ * refs/heads/main:refs/review/main/topic [new reference]
* HEAD:refs/heads/a/b/c [new branch]
Done
EOF
@@ -128,19 +128,19 @@ test_expect_success "git-push -f ($PROTOCOL/porcelain)" '
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
<COMMIT-A> refs/heads/a/b/c
- <COMMIT-A> refs/heads/master
- <COMMIT-A> refs/review/master/topic
+ <COMMIT-A> refs/heads/main
+ <COMMIT-A> refs/review/main/topic
<TAG-v123> refs/tags/v123
EOF
test_cmp expect actual
'
-# Refs of upstream : master(A) tags/v123 refs/review/master/topic(A) a/b/c(A)
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(A) tags/v123 refs/review/main/topic(A) a/b/c(A)
+# Refs of workbench: main(A) tags/v123
test_expect_success "cleanup ($PROTOCOL/porcelain)" '
(
cd "$upstream" &&
- git update-ref -d refs/review/master/topic &&
+ git update-ref -d refs/review/main/topic &&
git update-ref -d refs/tags/v123 &&
git update-ref -d refs/heads/a/b/c
)
diff --git a/t/t5411/test-0002-pre-receive-declined.sh b/t/t5411/test-0002-pre-receive-declined.sh
index c246f7e..e7d113a 100644
--- a/t/t5411/test-0002-pre-receive-declined.sh
+++ b/t/t5411/test-0002-pre-receive-declined.sh
@@ -5,25 +5,25 @@ test_expect_success "setup pre-receive hook ($PROTOCOL)" '
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git-push : master(B) next(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git-push : main(B) next(A)
test_expect_success "git-push is declined ($PROTOCOL)" '
test_must_fail git -C workbench push origin \
- $B:refs/heads/master \
+ $B:refs/heads/main \
HEAD:refs/heads/next \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
To <URL/of/upstream.git>
- ! [remote rejected] <COMMIT-B> -> master (pre-receive hook declined)
+ ! [remote rejected] <COMMIT-B> -> main (pre-receive hook declined)
! [remote rejected] HEAD -> next (pre-receive hook declined)
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
diff --git a/t/t5411/test-0003-pre-receive-declined--porcelain.sh b/t/t5411/test-0003-pre-receive-declined--porcelain.sh
index b14894d..cc0cca6 100644
--- a/t/t5411/test-0003-pre-receive-declined--porcelain.sh
+++ b/t/t5411/test-0003-pre-receive-declined--porcelain.sh
@@ -5,18 +5,18 @@ test_expect_success "setup pre-receive hook ($PROTOCOL/porcelain)" '
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git-push : master(B) next(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git-push : main(B) next(A)
test_expect_success "git-push is declined ($PROTOCOL/porcelain)" '
test_must_fail git -C workbench push --porcelain origin \
- $B:refs/heads/master \
+ $B:refs/heads/main \
HEAD:refs/heads/next \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
To <URL/of/upstream.git>
- ! <COMMIT-B>:refs/heads/master [remote rejected] (pre-receive hook declined)
+ ! <COMMIT-B>:refs/heads/main [remote rejected] (pre-receive hook declined)
! HEAD:refs/heads/next [remote rejected] (pre-receive hook declined)
Done
EOF
@@ -24,7 +24,7 @@ test_expect_success "git-push is declined ($PROTOCOL/porcelain)" '
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
diff --git a/t/t5411/test-0011-no-hook-error.sh b/t/t5411/test-0011-no-hook-error.sh
index bb6ec92..c508309 100644
--- a/t/t5411/test-0011-no-hook-error.sh
+++ b/t/t5411/test-0011-no-hook-error.sh
@@ -1,64 +1,64 @@
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : next(A) refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : next(A) refs/for/main/topic(A)
test_expect_success "proc-receive: no hook, fail to push special ref ($PROTOCOL)" '
test_must_fail git -C workbench push origin \
HEAD:next \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: error: cannot find hook "proc-receive"
remote: # post-receive hook
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
To <URL/of/upstream.git>
* [new branch] HEAD -> next
- ! [remote rejected] HEAD -> refs/for/master/topic (fail to run proc-receive hook)
+ ! [remote rejected] HEAD -> refs/for/main/topic (fail to run proc-receive hook)
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
<COMMIT-A> refs/heads/next
EOF
test_cmp expect actual
'
-# Refs of upstream : master(A) next(A)
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(A) next(A)
+# Refs of workbench: main(A) tags/v123
test_expect_success "cleanup ($PROTOCOL)" '
git -C "$upstream" update-ref -d refs/heads/next
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push --atomic: (B) next(A) refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push --atomic: (B) next(A) refs/for/main/topic(A)
test_expect_success "proc-receive: no hook, all failed for atomic push ($PROTOCOL)" '
test_must_fail git -C workbench push --atomic origin \
- $B:master \
+ $B:main \
HEAD:next \
- HEAD:refs/for/master/topic >out 2>&1 &&
+ HEAD:refs/for/main/topic >out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+ remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: error: cannot find hook "proc-receive"
To <URL/of/upstream.git>
- ! [remote rejected] <COMMIT-B> -> master (fail to run proc-receive hook)
+ ! [remote rejected] <COMMIT-B> -> main (fail to run proc-receive hook)
! [remote rejected] HEAD -> next (fail to run proc-receive hook)
- ! [remote rejected] HEAD -> refs/for/master/topic (fail to run proc-receive hook)
+ ! [remote rejected] HEAD -> refs/for/main/topic (fail to run proc-receive hook)
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
diff --git a/t/t5411/test-0012-no-hook-error--porcelain.sh b/t/t5411/test-0012-no-hook-error--porcelain.sh
index 4814f74..14ea433 100644
--- a/t/t5411/test-0012-no-hook-error--porcelain.sh
+++ b/t/t5411/test-0012-no-hook-error--porcelain.sh
@@ -1,66 +1,66 @@
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : next(A) refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : next(A) refs/for/main/topic(A)
test_expect_success "proc-receive: no hook, fail to push special ref ($PROTOCOL/porcelain)" '
test_must_fail git -C workbench push --porcelain origin \
HEAD:next \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: error: cannot find hook "proc-receive"
remote: # post-receive hook
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
To <URL/of/upstream.git>
* HEAD:refs/heads/next [new branch]
- ! HEAD:refs/for/master/topic [remote rejected] (fail to run proc-receive hook)
+ ! HEAD:refs/for/main/topic [remote rejected] (fail to run proc-receive hook)
Done
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
<COMMIT-A> refs/heads/next
EOF
test_cmp expect actual
'
-# Refs of upstream : master(A) next(A)
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(A) next(A)
+# Refs of workbench: main(A) tags/v123
test_expect_success "cleanup ($PROTOCOL/porcelain)" '
git -C "$upstream" update-ref -d refs/heads/next
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push --atomic: (B) next(A) refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push --atomic: (B) next(A) refs/for/main/topic(A)
test_expect_success "proc-receive: no hook, all failed for atomic push ($PROTOCOL/porcelain)" '
test_must_fail git -C workbench push --porcelain --atomic origin \
- $B:master \
+ $B:main \
HEAD:next \
- HEAD:refs/for/master/topic >out 2>&1 &&
+ HEAD:refs/for/main/topic >out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+ remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: error: cannot find hook "proc-receive"
To <URL/of/upstream.git>
- ! <COMMIT-B>:refs/heads/master [remote rejected] (fail to run proc-receive hook)
+ ! <COMMIT-B>:refs/heads/main [remote rejected] (fail to run proc-receive hook)
! HEAD:refs/heads/next [remote rejected] (fail to run proc-receive hook)
- ! HEAD:refs/for/master/topic [remote rejected] (fail to run proc-receive hook)
+ ! HEAD:refs/for/main/topic [remote rejected] (fail to run proc-receive hook)
Done
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
diff --git a/t/t5411/test-0013-bad-protocol.sh b/t/t5411/test-0013-bad-protocol.sh
index c5fe4cb..854c3e8 100644
--- a/t/t5411/test-0013-bad-protocol.sh
+++ b/t/t5411/test-0013-bad-protocol.sh
@@ -5,12 +5,12 @@ test_expect_success "setup proc-receive hook (unknown version, $PROTOCOL)" '
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/main/topic(A)
test_expect_success "proc-receive: bad protocol (unknown version, $PROTOCOL)" '
test_must_fail git -C workbench push origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
@@ -20,7 +20,7 @@ test_expect_success "proc-receive: bad protocol (unknown version, $PROTOCOL)" '
<actual >actual-report &&
cat >expect <<-EOF &&
To <URL/of/upstream.git>
- ! [remote rejected] HEAD -> refs/for/master/topic (fail to run proc-receive hook)
+ ! [remote rejected] HEAD -> refs/for/main/topic (fail to run proc-receive hook)
EOF
test_cmp expect actual-report &&
@@ -36,7 +36,7 @@ test_expect_success "proc-receive: bad protocol (unknown version, $PROTOCOL)" '
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
@@ -48,30 +48,30 @@ test_expect_success "setup proc-receive hook (hook --die-version, $PROTOCOL)" '
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/main/topic(A)
test_expect_success "proc-receive: bad protocol (hook --die-version, $PROTOCOL)" '
test_must_fail git -C workbench push origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
remote: fatal: bad protocol version: 1
remote: error: proc-receive version "0" is not supported
To <URL/of/upstream.git>
- ! [remote rejected] HEAD -> refs/for/master/topic (fail to run proc-receive hook)
+ ! [remote rejected] HEAD -> refs/for/main/topic (fail to run proc-receive hook)
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
@@ -83,21 +83,21 @@ test_expect_success "setup proc-receive hook (hook --die-readline, $PROTOCOL)" '
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/main/topic(A)
test_expect_success "proc-receive: bad protocol (hook --die-readline, $PROTOCOL)" '
test_must_fail git -C workbench push origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
- grep "remote: fatal: protocol error: expected \"old new ref\", got \"<ZERO-OID> <COMMIT-A> refs/for/master/topic\"" actual &&
+ grep "remote: fatal: protocol error: expected \"old new ref\", got \"<ZERO-OID> <COMMIT-A> refs/for/main/topic\"" actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
@@ -109,38 +109,38 @@ test_expect_success "setup proc-receive hook (no report, $PROTOCOL)" '
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : next(A) refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : next(A) refs/for/main/topic(A)
test_expect_success "proc-receive: bad protocol (no report, $PROTOCOL)" '
test_must_fail git -C workbench push origin \
HEAD:refs/heads/next \
- HEAD:refs/for/master/topic >out 2>&1 &&
+ HEAD:refs/for/main/topic >out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # post-receive hook
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
To <URL/of/upstream.git>
* [new branch] HEAD -> next
- ! [remote rejected] HEAD -> refs/for/master/topic (proc-receive failed to report status)
+ ! [remote rejected] HEAD -> refs/for/main/topic (proc-receive failed to report status)
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
<COMMIT-A> refs/heads/next
EOF
test_cmp expect actual
'
-# Refs of upstream : master(A) next(A)
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(A) next(A)
+# Refs of workbench: main(A) tags/v123
test_expect_success "cleanup ($PROTOCOL)" '
git -C "$upstream" update-ref -d refs/heads/next
@@ -154,29 +154,29 @@ test_expect_success "setup proc-receive hook (no ref, $PROTOCOL)" '
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/main/topic
test_expect_success "proc-receive: bad protocol (no ref, $PROTOCOL)" '
test_must_fail git -C workbench push origin \
- HEAD:refs/for/master/topic\
+ HEAD:refs/for/main/topic\
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: proc-receive> ok
remote: error: proc-receive reported incomplete status line: "ok"
To <URL/of/upstream.git>
- ! [remote rejected] HEAD -> refs/for/master/topic (proc-receive failed to report status)
+ ! [remote rejected] HEAD -> refs/for/main/topic (proc-receive failed to report status)
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
@@ -185,33 +185,33 @@ test_expect_success "setup proc-receive hook (unknown status, $PROTOCOL)" '
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "xx refs/for/master/topic"
+ -r "xx refs/for/main/topic"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/main/topic
test_expect_success "proc-receive: bad protocol (unknown status, $PROTOCOL)" '
test_must_fail git -C workbench push origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> xx refs/for/master/topic
- remote: error: proc-receive reported bad status "xx" on ref "refs/for/master/topic"
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> xx refs/for/main/topic
+ remote: error: proc-receive reported bad status "xx" on ref "refs/for/main/topic"
To <URL/of/upstream.git>
- ! [remote rejected] HEAD -> refs/for/master/topic (proc-receive failed to report status)
+ ! [remote rejected] HEAD -> refs/for/main/topic (proc-receive failed to report status)
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
diff --git a/t/t5411/test-0014-bad-protocol--porcelain.sh b/t/t5411/test-0014-bad-protocol--porcelain.sh
index 53b47b0..88c5631 100644
--- a/t/t5411/test-0014-bad-protocol--porcelain.sh
+++ b/t/t5411/test-0014-bad-protocol--porcelain.sh
@@ -5,12 +5,12 @@ test_expect_success "setup proc-receive hook (unknown version, $PROTOCOL/porcela
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/main/topic(A)
test_expect_success "proc-receive: bad protocol (unknown version, $PROTOCOL/porcelain)" '
test_must_fail git -C workbench push --porcelain origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
@@ -20,7 +20,7 @@ test_expect_success "proc-receive: bad protocol (unknown version, $PROTOCOL/porc
<actual >actual-report &&
cat >expect <<-EOF &&
To <URL/of/upstream.git>
- ! HEAD:refs/for/master/topic [remote rejected] (fail to run proc-receive hook)
+ ! HEAD:refs/for/main/topic [remote rejected] (fail to run proc-receive hook)
Done
EOF
test_cmp expect actual-report &&
@@ -37,7 +37,7 @@ test_expect_success "proc-receive: bad protocol (unknown version, $PROTOCOL/porc
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
@@ -49,39 +49,39 @@ test_expect_success "setup proc-receive hook (no report, $PROTOCOL/porcelain)" '
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : next(A) refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : next(A) refs/for/main/topic(A)
test_expect_success "proc-receive: bad protocol (no report, $PROTOCOL/porcelain)" '
test_must_fail git -C workbench push --porcelain origin \
HEAD:refs/heads/next \
- HEAD:refs/for/master/topic >out 2>&1 &&
+ HEAD:refs/for/main/topic >out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # post-receive hook
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
To <URL/of/upstream.git>
* HEAD:refs/heads/next [new branch]
- ! HEAD:refs/for/master/topic [remote rejected] (proc-receive failed to report status)
+ ! HEAD:refs/for/main/topic [remote rejected] (proc-receive failed to report status)
Done
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
<COMMIT-A> refs/heads/next
EOF
test_cmp expect actual
'
-# Refs of upstream : master(A) next(A)
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(A) next(A)
+# Refs of workbench: main(A) tags/v123
test_expect_success "cleanup ($PROTOCOL/porcelain)" '
git -C "$upstream" update-ref -d refs/heads/next
@@ -95,30 +95,30 @@ test_expect_success "setup proc-receive hook (no ref, $PROTOCOL/porcelain)" '
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/main/topic
test_expect_success "proc-receive: bad protocol (no ref, $PROTOCOL/porcelain)" '
test_must_fail git -C workbench push --porcelain origin \
- HEAD:refs/for/master/topic\
+ HEAD:refs/for/main/topic\
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: proc-receive> ok
remote: error: proc-receive reported incomplete status line: "ok"
To <URL/of/upstream.git>
- ! HEAD:refs/for/master/topic [remote rejected] (proc-receive failed to report status)
+ ! HEAD:refs/for/main/topic [remote rejected] (proc-receive failed to report status)
Done
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
@@ -127,34 +127,34 @@ test_expect_success "setup proc-receive hook (unknown status, $PROTOCOL/porcelai
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "xx refs/for/master/topic"
+ -r "xx refs/for/main/topic"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/main/topic
test_expect_success "proc-receive: bad protocol (unknown status, $PROTOCOL/porcelain)" '
test_must_fail git -C workbench push --porcelain origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> xx refs/for/master/topic
- remote: error: proc-receive reported bad status "xx" on ref "refs/for/master/topic"
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> xx refs/for/main/topic
+ remote: error: proc-receive reported bad status "xx" on ref "refs/for/main/topic"
To <URL/of/upstream.git>
- ! HEAD:refs/for/master/topic [remote rejected] (proc-receive failed to report status)
+ ! HEAD:refs/for/main/topic [remote rejected] (proc-receive failed to report status)
Done
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
diff --git a/t/t5411/test-0020-report-ng.sh b/t/t5411/test-0020-report-ng.sh
index f726b7c..5a9e0da 100644
--- a/t/t5411/test-0020-report-ng.sh
+++ b/t/t5411/test-0020-report-ng.sh
@@ -2,32 +2,32 @@ test_expect_success "setup proc-receive hook (ng, no message, $PROTOCOL)" '
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ng refs/for/master/topic"
+ -r "ng refs/for/main/topic"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/main/topic
test_expect_success "proc-receive: fail to update (ng, no message, $PROTOCOL)" '
test_must_fail git -C workbench push origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ng refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ng refs/for/main/topic
To <URL/of/upstream.git>
- ! [remote rejected] HEAD -> refs/for/master/topic (failed)
+ ! [remote rejected] HEAD -> refs/for/main/topic (failed)
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
@@ -36,32 +36,32 @@ test_expect_success "setup proc-receive hook (ng message, $PROTOCOL)" '
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ng refs/for/master/topic error msg"
+ -r "ng refs/for/main/topic error msg"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/main/topic
test_expect_success "proc-receive: fail to update (ng, with message, $PROTOCOL)" '
test_must_fail git -C workbench push origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ng refs/for/master/topic error msg
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ng refs/for/main/topic error msg
To <URL/of/upstream.git>
- ! [remote rejected] HEAD -> refs/for/master/topic (error msg)
+ ! [remote rejected] HEAD -> refs/for/main/topic (error msg)
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
diff --git a/t/t5411/test-0021-report-ng--porcelain.sh b/t/t5411/test-0021-report-ng--porcelain.sh
index fbf5569..93475a8 100644
--- a/t/t5411/test-0021-report-ng--porcelain.sh
+++ b/t/t5411/test-0021-report-ng--porcelain.sh
@@ -2,33 +2,33 @@ test_expect_success "setup proc-receive hook (ng, no message, $PROTOCOL/porcelai
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ng refs/for/master/topic"
+ -r "ng refs/for/main/topic"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/main/topic
test_expect_success "proc-receive: fail to update (ng, no message, $PROTOCOL/porcelain)" '
test_must_fail git -C workbench push --porcelain origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ng refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ng refs/for/main/topic
To <URL/of/upstream.git>
- ! HEAD:refs/for/master/topic [remote rejected] (failed)
+ ! HEAD:refs/for/main/topic [remote rejected] (failed)
Done
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
@@ -37,33 +37,33 @@ test_expect_success "setup proc-receive hook (ng message, $PROTOCOL/porcelain)"
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ng refs/for/master/topic error msg"
+ -r "ng refs/for/main/topic error msg"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/main/topic
test_expect_success "proc-receive: fail to update (ng, with message, $PROTOCOL/porcelain)" '
test_must_fail git -C workbench push --porcelain origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ng refs/for/master/topic error msg
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ng refs/for/main/topic error msg
To <URL/of/upstream.git>
- ! HEAD:refs/for/master/topic [remote rejected] (error msg)
+ ! HEAD:refs/for/main/topic [remote rejected] (error msg)
Done
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
diff --git a/t/t5411/test-0022-report-unexpect-ref.sh b/t/t5411/test-0022-report-unexpect-ref.sh
index 92a415b..f8be8a0 100644
--- a/t/t5411/test-0022-report-unexpect-ref.sh
+++ b/t/t5411/test-0022-report-unexpect-ref.sh
@@ -2,44 +2,44 @@ test_expect_success "setup proc-receive hook (unexpected ref, $PROTOCOL)" '
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/heads/master"
+ -r "ok refs/heads/main"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : (B) refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : (B) refs/for/main/topic
test_expect_success "proc-receive: report unexpected ref ($PROTOCOL)" '
test_must_fail git -C workbench push origin \
- $B:refs/heads/master \
- HEAD:refs/for/master/topic \
+ $B:refs/heads/main \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ok refs/heads/master
- remote: error: proc-receive reported status on unexpected ref: refs/heads/master
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ok refs/heads/main
+ remote: error: proc-receive reported status on unexpected ref: refs/heads/main
remote: # post-receive hook
- remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
To <URL/of/upstream.git>
- <OID-A>..<OID-B> <COMMIT-B> -> master
- ! [remote rejected] HEAD -> refs/for/master/topic (proc-receive failed to report status)
+ <OID-A>..<OID-B> <COMMIT-B> -> main
+ ! [remote rejected] HEAD -> refs/for/main/topic (proc-receive failed to report status)
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-B> refs/heads/master
+ <COMMIT-B> refs/heads/main
EOF
test_cmp expect actual
'
-# Refs of upstream : master(B)
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(B)
+# Refs of workbench: main(A) tags/v123
test_expect_success "cleanup ($PROTOCOL)" '
- git -C "$upstream" update-ref refs/heads/master $A
+ git -C "$upstream" update-ref refs/heads/main $A
'
diff --git a/t/t5411/test-0023-report-unexpect-ref--porcelain.sh b/t/t5411/test-0023-report-unexpect-ref--porcelain.sh
index acbf93e..778150f 100644
--- a/t/t5411/test-0023-report-unexpect-ref--porcelain.sh
+++ b/t/t5411/test-0023-report-unexpect-ref--porcelain.sh
@@ -2,45 +2,45 @@ test_expect_success "setup proc-receive hook (unexpected ref, $PROTOCOL/porcelai
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/heads/master"
+ -r "ok refs/heads/main"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : (B) refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : (B) refs/for/main/topic
test_expect_success "proc-receive: report unexpected ref ($PROTOCOL/porcelain)" '
test_must_fail git -C workbench push --porcelain origin \
- $B:refs/heads/master \
- HEAD:refs/for/master/topic \
+ $B:refs/heads/main \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ok refs/heads/master
- remote: error: proc-receive reported status on unexpected ref: refs/heads/master
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ok refs/heads/main
+ remote: error: proc-receive reported status on unexpected ref: refs/heads/main
remote: # post-receive hook
- remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
To <URL/of/upstream.git>
- <COMMIT-B>:refs/heads/master <OID-A>..<OID-B>
- ! HEAD:refs/for/master/topic [remote rejected] (proc-receive failed to report status)
+ <COMMIT-B>:refs/heads/main <OID-A>..<OID-B>
+ ! HEAD:refs/for/main/topic [remote rejected] (proc-receive failed to report status)
Done
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-B> refs/heads/master
+ <COMMIT-B> refs/heads/main
EOF
test_cmp expect actual
'
-# Refs of upstream : master(B)
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(B)
+# Refs of workbench: main(A) tags/v123
test_expect_success "cleanup ($PROTOCOL/porcelain)" '
- git -C "$upstream" update-ref refs/heads/master $A
+ git -C "$upstream" update-ref refs/heads/main $A
'
diff --git a/t/t5411/test-0024-report-unknown-ref.sh b/t/t5411/test-0024-report-unknown-ref.sh
index c3946f3..d4e74e4 100644
--- a/t/t5411/test-0024-report-unknown-ref.sh
+++ b/t/t5411/test-0024-report-unknown-ref.sh
@@ -2,12 +2,12 @@ test_expect_success "setup proc-receive hook (unexpected ref, $PROTOCOL)" '
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic"
+ -r "ok refs/for/main/topic"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
# git push : refs/for/a/b/c/my/topic
test_expect_success "proc-receive: report unknown reference ($PROTOCOL)" '
test_must_fail git -C workbench push origin \
@@ -19,8 +19,8 @@ test_expect_success "proc-receive: report unknown reference ($PROTOCOL)" '
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/my/topic
remote: # proc-receive hook
remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/my/topic
- remote: proc-receive> ok refs/for/master/topic
- remote: error: proc-receive reported status on unknown ref: refs/for/master/topic
+ remote: proc-receive> ok refs/for/main/topic
+ remote: error: proc-receive reported status on unknown ref: refs/for/main/topic
To <URL/of/upstream.git>
! [remote rejected] HEAD -> refs/for/a/b/c/my/topic (proc-receive failed to report status)
EOF
@@ -28,7 +28,7 @@ test_expect_success "proc-receive: report unknown reference ($PROTOCOL)" '
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
diff --git a/t/t5411/test-0025-report-unknown-ref--porcelain.sh b/t/t5411/test-0025-report-unknown-ref--porcelain.sh
index d093b1a..039e8b6 100644
--- a/t/t5411/test-0025-report-unknown-ref--porcelain.sh
+++ b/t/t5411/test-0025-report-unknown-ref--porcelain.sh
@@ -2,12 +2,12 @@ test_expect_success "setup proc-receive hook (unexpected ref, $PROTOCOL/porcelai
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic"
+ -r "ok refs/for/main/topic"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
# git push : refs/for/a/b/c/my/topic
test_expect_success "proc-receive: report unknown reference ($PROTOCOL/porcelain)" '
test_must_fail git -C workbench push --porcelain origin \
@@ -19,8 +19,8 @@ test_expect_success "proc-receive: report unknown reference ($PROTOCOL/porcelain
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/my/topic
remote: # proc-receive hook
remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/my/topic
- remote: proc-receive> ok refs/for/master/topic
- remote: error: proc-receive reported status on unknown ref: refs/for/master/topic
+ remote: proc-receive> ok refs/for/main/topic
+ remote: error: proc-receive reported status on unknown ref: refs/for/main/topic
To <URL/of/upstream.git>
! HEAD:refs/for/a/b/c/my/topic [remote rejected] (proc-receive failed to report status)
Done
@@ -29,7 +29,7 @@ test_expect_success "proc-receive: report unknown reference ($PROTOCOL/porcelain
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
diff --git a/t/t5411/test-0026-push-options.sh b/t/t5411/test-0026-push-options.sh
index d0c4da8..d414be8 100644
--- a/t/t5411/test-0026-push-options.sh
+++ b/t/t5411/test-0026-push-options.sh
@@ -3,19 +3,19 @@ test_expect_success "setup proc-receive hook and disable push-options ($PROTOCOL
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic"
+ -r "ok refs/for/main/topic"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push -o ... : refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push -o ... : refs/for/main/topic
test_expect_success "proc-receive: not support push options ($PROTOCOL)" '
test_must_fail git -C workbench push \
-o issue=123 \
-o reviewer=user1 \
origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
test_i18ngrep "fatal: the receiving end does not support push options" \
@@ -23,7 +23,7 @@ test_expect_success "proc-receive: not support push options ($PROTOCOL)" '
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
@@ -32,9 +32,9 @@ test_expect_success "enable push options ($PROTOCOL)" '
git -C "$upstream" config receive.advertisePushOptions true
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push -o ... : next(A) refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push -o ... : next(A) refs/for/main/topic
test_expect_success "proc-receive: push with options ($PROTOCOL)" '
git -C workbench push \
--atomic \
@@ -42,38 +42,38 @@ test_expect_success "proc-receive: push with options ($PROTOCOL)" '
-o reviewer=user1 \
origin \
HEAD:refs/heads/next \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
remote: proc-receive: atomic push_options
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: proc-receive< issue=123
remote: proc-receive< reviewer=user1
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: # post-receive hook
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
To <URL/of/upstream.git>
* [new branch] HEAD -> next
- * [new reference] HEAD -> refs/for/master/topic
+ * [new reference] HEAD -> refs/for/main/topic
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
<COMMIT-A> refs/heads/next
EOF
test_cmp expect actual
'
-# Refs of upstream : master(A) next(A)
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(A) next(A)
+# Refs of workbench: main(A) tags/v123
test_expect_success "cleanup ($PROTOCOL)" '
git -C "$upstream" update-ref -d refs/heads/next
'
diff --git a/t/t5411/test-0027-push-options--porcelain.sh b/t/t5411/test-0027-push-options--porcelain.sh
index c89a1e7..d5d0dcb 100644
--- a/t/t5411/test-0027-push-options--porcelain.sh
+++ b/t/t5411/test-0027-push-options--porcelain.sh
@@ -3,20 +3,20 @@ test_expect_success "setup proc-receive hook and disable push-options ($PROTOCOL
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic"
+ -r "ok refs/for/main/topic"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push -o ... : refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push -o ... : refs/for/main/topic
test_expect_success "proc-receive: not support push options ($PROTOCOL/porcelain)" '
test_must_fail git -C workbench push \
--porcelain \
-o issue=123 \
-o reviewer=user1 \
origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
test_i18ngrep "fatal: the receiving end does not support push options" \
@@ -24,7 +24,7 @@ test_expect_success "proc-receive: not support push options ($PROTOCOL/porcelain
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
@@ -33,9 +33,9 @@ test_expect_success "enable push options ($PROTOCOL/porcelain)" '
git -C "$upstream" config receive.advertisePushOptions true
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push -o ... : next(A) refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push -o ... : next(A) refs/for/main/topic
test_expect_success "proc-receive: push with options ($PROTOCOL/porcelain)" '
git -C workbench push \
--porcelain \
@@ -44,39 +44,39 @@ test_expect_success "proc-receive: push with options ($PROTOCOL/porcelain)" '
-o reviewer=user1 \
origin \
HEAD:refs/heads/next \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
remote: proc-receive: atomic push_options
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: proc-receive< issue=123
remote: proc-receive< reviewer=user1
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: # post-receive hook
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
To <URL/of/upstream.git>
* HEAD:refs/heads/next [new branch]
- * HEAD:refs/for/master/topic [new reference]
+ * HEAD:refs/for/main/topic [new reference]
Done
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
<COMMIT-A> refs/heads/next
EOF
test_cmp expect actual
'
-# Refs of upstream : master(A) next(A)
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(A) next(A)
+# Refs of workbench: main(A) tags/v123
test_expect_success "cleanup ($PROTOCOL/porcelain)" '
git -C "$upstream" update-ref -d refs/heads/next
'
diff --git a/t/t5411/test-0030-report-ok.sh b/t/t5411/test-0030-report-ok.sh
index 44c99d3..5d6feef 100644
--- a/t/t5411/test-0030-report-ok.sh
+++ b/t/t5411/test-0030-report-ok.sh
@@ -2,34 +2,34 @@ test_expect_success "setup proc-receive hook (ok, $PROTOCOL)" '
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic"
+ -r "ok refs/for/main/topic"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/main/topic
test_expect_success "proc-receive: ok ($PROTOCOL)" '
git -C workbench push origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: # post-receive hook
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
To <URL/of/upstream.git>
- * [new reference] HEAD -> refs/for/master/topic
+ * [new reference] HEAD -> refs/for/main/topic
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
diff --git a/t/t5411/test-0031-report-ok--porcelain.sh b/t/t5411/test-0031-report-ok--porcelain.sh
index 3223b26..91666d3 100644
--- a/t/t5411/test-0031-report-ok--porcelain.sh
+++ b/t/t5411/test-0031-report-ok--porcelain.sh
@@ -2,35 +2,35 @@ test_expect_success "setup proc-receive hook (ok, $PROTOCOL/porcelain)" '
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic"
+ -r "ok refs/for/main/topic"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/main/topic
test_expect_success "proc-receive: ok ($PROTOCOL/porcelain)" '
git -C workbench push --porcelain origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: # post-receive hook
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
To <URL/of/upstream.git>
- * HEAD:refs/for/master/topic [new reference]
+ * HEAD:refs/for/main/topic [new reference]
Done
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
diff --git a/t/t5411/test-0032-report-with-options.sh b/t/t5411/test-0032-report-with-options.sh
index b77b78c..a0faf5c 100644
--- a/t/t5411/test-0032-report-with-options.sh
+++ b/t/t5411/test-0032-report-with-options.sh
@@ -7,24 +7,24 @@ test_expect_success "setup proc-receive hook (option without matching ok, $PROTO
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/main/topic(A)
test_expect_success "proc-receive: report option without matching ok ($PROTOCOL)" '
test_must_fail git -C workbench push origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: proc-receive> option refname refs/pull/123/head
remote: proc-receive> option old-oid <COMMIT-B>
remote: error: proc-receive reported "option" without a matching "ok/ng" directive
To <URL/of/upstream.git>
- ! [remote rejected] HEAD -> refs/for/master/topic (proc-receive failed to report status)
+ ! [remote rejected] HEAD -> refs/for/main/topic (proc-receive failed to report status)
EOF
test_cmp expect actual
'
@@ -33,25 +33,25 @@ test_expect_success "setup proc-receive hook (option refname, $PROTOCOL)" '
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option refname refs/pull/123/head"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/main/topic(A)
test_expect_success "proc-receive: report option refname ($PROTOCOL)" '
git -C workbench push origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option refname refs/pull/123/head
remote: # post-receive hook
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/123/head
@@ -65,25 +65,25 @@ test_expect_success "setup proc-receive hook (option refname and forced-update,
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option refname refs/pull/123/head" \
-r "option forced-update"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/main/topic(A)
test_expect_success "proc-receive: report option refname and forced-update ($PROTOCOL)" '
git -C workbench push origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option refname refs/pull/123/head
remote: proc-receive> option forced-update
remote: # post-receive hook
@@ -98,26 +98,26 @@ test_expect_success "setup proc-receive hook (option refname and old-oid, $PROTO
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option refname refs/pull/123/head" \
-r "option old-oid $B"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/main/topic(A)
test_expect_success "proc-receive: report option refname and old-oid ($PROTOCOL)" '
git -C workbench push origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option refname refs/pull/123/head
remote: proc-receive> option old-oid <COMMIT-B>
remote: # post-receive hook
@@ -132,30 +132,30 @@ test_expect_success "setup proc-receive hook (option old-oid, $PROTOCOL)" '
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option old-oid $B"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/main/topic(A)
test_expect_success "proc-receive: report option old-oid ($PROTOCOL)" '
git -C workbench push origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option old-oid <COMMIT-B>
remote: # post-receive hook
- remote: post-receive< <COMMIT-B> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <COMMIT-B> <COMMIT-A> refs/for/main/topic
To <URL/of/upstream.git>
- <OID-B>..<OID-A> HEAD -> refs/for/master/topic
+ <OID-B>..<OID-A> HEAD -> refs/for/main/topic
EOF
test_cmp expect actual
'
@@ -164,32 +164,32 @@ test_expect_success "setup proc-receive hook (option old-oid and new-oid, $PROTO
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option old-oid $A" \
-r "option new-oid $B"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/main/topic(A)
test_expect_success "proc-receive: report option old-oid and new-oid ($PROTOCOL)" '
git -C workbench push origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option old-oid <COMMIT-A>
remote: proc-receive> option new-oid <COMMIT-B>
remote: # post-receive hook
- remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic
To <URL/of/upstream.git>
- <OID-A>..<OID-B> HEAD -> refs/for/master/topic
+ <OID-A>..<OID-B> HEAD -> refs/for/main/topic
EOF
test_cmp expect actual
'
@@ -201,7 +201,7 @@ test_expect_success "setup proc-receive hook (report with multiple rewrites, $PR
-r "ok refs/for/a/b/c/topic" \
-r "ok refs/for/next/topic" \
-r "option refname refs/pull/123/head" \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option refname refs/pull/124/head" \
-r "option old-oid $B" \
-r "option forced-update" \
@@ -209,29 +209,29 @@ test_expect_success "setup proc-receive hook (report with multiple rewrites, $PR
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/main/topic(A)
test_expect_success "proc-receive: report with multiple rewrites ($PROTOCOL)" '
git -C workbench push origin \
HEAD:refs/for/next/topic \
HEAD:refs/for/a/b/c/topic \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/topic
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/topic
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: proc-receive> ok refs/for/a/b/c/topic
remote: proc-receive> ok refs/for/next/topic
remote: proc-receive> option refname refs/pull/123/head
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option refname refs/pull/124/head
remote: proc-receive> option old-oid <COMMIT-B>
remote: proc-receive> option forced-update
@@ -250,7 +250,7 @@ test_expect_success "proc-receive: report with multiple rewrites ($PROTOCOL)" '
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
diff --git a/t/t5411/test-0033-report-with-options--porcelain.sh b/t/t5411/test-0033-report-with-options--porcelain.sh
index 1fe352b..32ae26b 100644
--- a/t/t5411/test-0033-report-with-options--porcelain.sh
+++ b/t/t5411/test-0033-report-with-options--porcelain.sh
@@ -7,24 +7,24 @@ test_expect_success "setup proc-receive hook (option without matching ok, $PROTO
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/main/topic(A)
test_expect_success "proc-receive: report option without matching ok ($PROTOCOL/porcelain)" '
test_must_fail git -C workbench push --porcelain origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: proc-receive> option refname refs/pull/123/head
remote: proc-receive> option old-oid <COMMIT-B>
remote: error: proc-receive reported "option" without a matching "ok/ng" directive
To <URL/of/upstream.git>
- ! HEAD:refs/for/master/topic [remote rejected] (proc-receive failed to report status)
+ ! HEAD:refs/for/main/topic [remote rejected] (proc-receive failed to report status)
Done
EOF
test_cmp expect actual
@@ -34,25 +34,25 @@ test_expect_success "setup proc-receive hook (option refname, $PROTOCOL/porcelai
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option refname refs/pull/123/head"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/main/topic(A)
test_expect_success "proc-receive: report option refname ($PROTOCOL/porcelain)" '
git -C workbench push --porcelain origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option refname refs/pull/123/head
remote: # post-receive hook
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/123/head
@@ -67,26 +67,26 @@ test_expect_success "setup proc-receive hook (option refname and forced-update,
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option refname refs/pull/123/head" \
-r "option forced-update"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/main/topic(A)
test_expect_success "proc-receive: report option refname and forced-update ($PROTOCOL/porcelain)" '
git -C workbench push --porcelain origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option refname refs/pull/123/head
remote: proc-receive> option forced-update
remote: # post-receive hook
@@ -102,26 +102,26 @@ test_expect_success "setup proc-receive hook (option refname and old-oid, $PROTO
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option refname refs/pull/123/head" \
-r "option old-oid $B"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/main/topic(A)
test_expect_success "proc-receive: report option refname and old-oid ($PROTOCOL/porcelain)" '
git -C workbench push --porcelain origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option refname refs/pull/123/head
remote: proc-receive> option old-oid <COMMIT-B>
remote: # post-receive hook
@@ -137,30 +137,30 @@ test_expect_success "setup proc-receive hook (option old-oid, $PROTOCOL/porcelai
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option old-oid $B"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/main/topic(A)
test_expect_success "proc-receive: report option old-oid ($PROTOCOL/porcelain)" '
git -C workbench push --porcelain origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option old-oid <COMMIT-B>
remote: # post-receive hook
- remote: post-receive< <COMMIT-B> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <COMMIT-B> <COMMIT-A> refs/for/main/topic
To <URL/of/upstream.git>
- HEAD:refs/for/master/topic <OID-B>..<OID-A>
+ HEAD:refs/for/main/topic <OID-B>..<OID-A>
Done
EOF
test_cmp expect actual
@@ -170,32 +170,32 @@ test_expect_success "setup proc-receive hook (option old-oid and new-oid, $PROTO
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option old-oid $A" \
-r "option new-oid $B"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/main/topic(A)
test_expect_success "proc-receive: report option old-oid and new-oid ($PROTOCOL/porcelain)" '
git -C workbench push --porcelain origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option old-oid <COMMIT-A>
remote: proc-receive> option new-oid <COMMIT-B>
remote: # post-receive hook
- remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic
To <URL/of/upstream.git>
- HEAD:refs/for/master/topic <OID-A>..<OID-B>
+ HEAD:refs/for/main/topic <OID-A>..<OID-B>
Done
EOF
test_cmp expect actual
@@ -208,7 +208,7 @@ test_expect_success "setup proc-receive hook (report with multiple rewrites, $PR
-r "ok refs/for/a/b/c/topic" \
-r "ok refs/for/next/topic" \
-r "option refname refs/pull/123/head" \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option refname refs/pull/124/head" \
-r "option old-oid $B" \
-r "option forced-update" \
@@ -217,29 +217,29 @@ test_expect_success "setup proc-receive hook (report with multiple rewrites, $PR
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/next/topic(A) refs/for/a/b/c/topic(A) refs/for/main/topic(A)
test_expect_success "proc-receive: report with multiple rewrites ($PROTOCOL/porcelain)" '
git -C workbench push --porcelain origin \
HEAD:refs/for/next/topic \
HEAD:refs/for/a/b/c/topic \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/topic
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/topic
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: proc-receive> ok refs/for/a/b/c/topic
remote: proc-receive> ok refs/for/next/topic
remote: proc-receive> option refname refs/pull/123/head
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option refname refs/pull/124/head
remote: proc-receive> option old-oid <COMMIT-B>
remote: proc-receive> option forced-update
@@ -259,7 +259,7 @@ test_expect_success "proc-receive: report with multiple rewrites ($PROTOCOL/porc
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
diff --git a/t/t5411/test-0034-report-ft.sh b/t/t5411/test-0034-report-ft.sh
index aca2b06..c355c29 100644
--- a/t/t5411/test-0034-report-ft.sh
+++ b/t/t5411/test-0034-report-ft.sh
@@ -2,43 +2,43 @@ test_expect_success "setup proc-receive hook (ft, $PROTOCOL)" '
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option fall-through"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/master/topic(B)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/main/topic(B)
test_expect_success "proc-receive: fall throught, let receive-pack to execute ($PROTOCOL)" '
git -C workbench push origin \
- $B:refs/for/master/topic \
+ $B:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-B> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-B> refs/for/master/topic
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option fall-through
remote: # post-receive hook
- remote: post-receive< <ZERO-OID> <COMMIT-B> refs/for/master/topic
+ remote: post-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic
To <URL/of/upstream.git>
- * [new reference] <COMMIT-B> -> refs/for/master/topic
+ * [new reference] <COMMIT-B> -> refs/for/main/topic
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-B> refs/for/master/topic
- <COMMIT-A> refs/heads/master
+ <COMMIT-B> refs/for/main/topic
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
-# Refs of upstream : master(A) refs/for/master/topic(A)
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(A) refs/for/main/topic(A)
+# Refs of workbench: main(A) tags/v123
test_expect_success "cleanup ($PROTOCOL)" '
- git -C "$upstream" update-ref -d refs/for/master/topic
+ git -C "$upstream" update-ref -d refs/for/main/topic
'
diff --git a/t/t5411/test-0035-report-ft--porcelain.sh b/t/t5411/test-0035-report-ft--porcelain.sh
index 30ffffb..8ce4e58 100644
--- a/t/t5411/test-0035-report-ft--porcelain.sh
+++ b/t/t5411/test-0035-report-ft--porcelain.sh
@@ -2,44 +2,44 @@ test_expect_success "setup proc-receive hook (fall-through, $PROTOCOL/porcelain)
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option fall-through"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/master/topic(B)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/main/topic(B)
test_expect_success "proc-receive: fall throught, let receive-pack to execute ($PROTOCOL/porcelain)" '
git -C workbench push --porcelain origin \
- $B:refs/for/master/topic \
+ $B:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-B> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-B> refs/for/master/topic
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option fall-through
remote: # post-receive hook
- remote: post-receive< <ZERO-OID> <COMMIT-B> refs/for/master/topic
+ remote: post-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic
To <URL/of/upstream.git>
- * <COMMIT-B>:refs/for/master/topic [new reference]
+ * <COMMIT-B>:refs/for/main/topic [new reference]
Done
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-B> refs/for/master/topic
- <COMMIT-A> refs/heads/master
+ <COMMIT-B> refs/for/main/topic
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
-# Refs of upstream : master(A) refs/for/master/topic(A)
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(A) refs/for/main/topic(A)
+# Refs of workbench: main(A) tags/v123
test_expect_success "cleanup ($PROTOCOL/porcelain)" '
- git -C "$upstream" update-ref -d refs/for/master/topic
+ git -C "$upstream" update-ref -d refs/for/main/topic
'
diff --git a/t/t5411/test-0036-report-multi-rewrite-for-one-ref.sh b/t/t5411/test-0036-report-multi-rewrite-for-one-ref.sh
index 73283d8..fad8eea 100644
--- a/t/t5411/test-0036-report-multi-rewrite-for-one-ref.sh
+++ b/t/t5411/test-0036-report-multi-rewrite-for-one-ref.sh
@@ -17,50 +17,50 @@ test_expect_success "setup proc-receive hook (multiple rewrites for one ref, no
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option old-oid $A" \
-r "option new-oid $B" \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option refname refs/changes/24/124/1" \
-r "option old-oid $ZERO_OID" \
-r "option new-oid $A" \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option refname refs/changes/25/125/1" \
-r "option old-oid $A" \
-r "option new-oid $B"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/main/topic(A)
test_expect_success "proc-receive: multiple rewrite for one ref, no refname for the 1st rewrite ($PROTOCOL)" '
git -C workbench push origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option old-oid <COMMIT-A>
remote: proc-receive> option new-oid <COMMIT-B>
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option refname refs/changes/24/124/1
remote: proc-receive> option old-oid <ZERO-OID>
remote: proc-receive> option new-oid <COMMIT-A>
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option refname refs/changes/25/125/1
remote: proc-receive> option old-oid <COMMIT-A>
remote: proc-receive> option new-oid <COMMIT-B>
remote: # post-receive hook
- remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/24/124/1
remote: post-receive< <COMMIT-A> <COMMIT-B> refs/changes/25/125/1
To <URL/of/upstream.git>
- <OID-A>..<OID-B> HEAD -> refs/for/master/topic
+ <OID-A>..<OID-B> HEAD -> refs/for/main/topic
* [new reference] HEAD -> refs/changes/24/124/1
<OID-A>..<OID-B> HEAD -> refs/changes/25/125/1
EOF
@@ -68,7 +68,7 @@ test_expect_success "proc-receive: multiple rewrite for one ref, no refname for
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
@@ -80,10 +80,10 @@ test_expect_success "proc-receive: check remote-tracking #1 ($PROTOCOL)" '
cat >expect <<-EOF &&
<COMMIT-A> refs/t/changes/24/124/1
<COMMIT-B> refs/t/changes/25/125/1
- <COMMIT-B> refs/t/for/master/topic
+ <COMMIT-B> refs/t/for/main/topic
EOF
test_cmp expect actual &&
- git -C workbench update-ref -d refs/t/for/master/topic &&
+ git -C workbench update-ref -d refs/t/for/main/topic &&
git -C workbench update-ref -d refs/t/changes/24/124/1 &&
git -C workbench update-ref -d refs/t/changes/25/125/1
'
@@ -92,14 +92,14 @@ test_expect_success "setup proc-receive hook (multiple rewrites for one ref, no
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option refname refs/changes/24/124/1" \
-r "option old-oid $ZERO_OID" \
-r "option new-oid $A" \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option old-oid $A" \
-r "option new-oid $B" \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option refname refs/changes/25/125/1" \
-r "option old-oid $B" \
-r "option new-oid $A" \
@@ -107,45 +107,45 @@ test_expect_success "setup proc-receive hook (multiple rewrites for one ref, no
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/main/topic(A)
test_expect_success "proc-receive: multiple rewrites for one ref, no refname for the 2nd rewrite ($PROTOCOL)" '
git -C workbench push origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option refname refs/changes/24/124/1
remote: proc-receive> option old-oid <ZERO-OID>
remote: proc-receive> option new-oid <COMMIT-A>
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option old-oid <COMMIT-A>
remote: proc-receive> option new-oid <COMMIT-B>
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option refname refs/changes/25/125/1
remote: proc-receive> option old-oid <COMMIT-B>
remote: proc-receive> option new-oid <COMMIT-A>
remote: proc-receive> option forced-update
remote: # post-receive hook
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/24/124/1
- remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic
remote: post-receive< <COMMIT-B> <COMMIT-A> refs/changes/25/125/1
To <URL/of/upstream.git>
* [new reference] HEAD -> refs/changes/24/124/1
- <OID-A>..<OID-B> HEAD -> refs/for/master/topic
+ <OID-A>..<OID-B> HEAD -> refs/for/main/topic
+ <OID-B>...<OID-A> HEAD -> refs/changes/25/125/1 (forced update)
EOF
test_cmp expect actual &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
@@ -157,10 +157,10 @@ test_expect_success "proc-receive: check remote-tracking #2 ($PROTOCOL)" '
cat >expect <<-EOF &&
<COMMIT-A> refs/t/changes/24/124/1
<COMMIT-A> refs/t/changes/25/125/1
- <COMMIT-B> refs/t/for/master/topic
+ <COMMIT-B> refs/t/for/main/topic
EOF
test_cmp expect actual &&
- git -C workbench update-ref -d refs/t/for/master/topic &&
+ git -C workbench update-ref -d refs/t/for/main/topic &&
git -C workbench update-ref -d refs/t/changes/24/124/1 &&
git -C workbench update-ref -d refs/t/changes/25/125/1
'
@@ -169,31 +169,31 @@ test_expect_success "setup proc-receive hook (multiple rewrites for one ref, $PR
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option refname refs/changes/23/123/1" \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option refname refs/changes/24/124/2" \
-r "option old-oid $A" \
-r "option new-oid $B"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/main/topic(A)
test_expect_success "proc-receive: multiple rewrites for one ref ($PROTOCOL)" '
git -C workbench push origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option refname refs/changes/23/123/1
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option refname refs/changes/24/124/2
remote: proc-receive> option old-oid <COMMIT-A>
remote: proc-receive> option new-oid <COMMIT-B>
@@ -208,7 +208,7 @@ test_expect_success "proc-receive: multiple rewrites for one ref ($PROTOCOL)" '
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
diff --git a/t/t5411/test-0037-report-multi-rewrite-for-one-ref--porcelain.sh b/t/t5411/test-0037-report-multi-rewrite-for-one-ref--porcelain.sh
index 77b5b22..dc254d5 100644
--- a/t/t5411/test-0037-report-multi-rewrite-for-one-ref--porcelain.sh
+++ b/t/t5411/test-0037-report-multi-rewrite-for-one-ref--porcelain.sh
@@ -2,50 +2,50 @@ test_expect_success "setup proc-receive hook (multiple rewrites for one ref, no
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option old-oid $A" \
-r "option new-oid $B" \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option refname refs/changes/24/124/1" \
-r "option old-oid $ZERO_OID" \
-r "option new-oid $A" \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option refname refs/changes/25/125/1" \
-r "option old-oid $A" \
-r "option new-oid $B"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/main/topic(A)
test_expect_success "proc-receive: multiple rewrite for one ref, no refname for the 1st rewrite ($PROTOCOL/porcelain)" '
git -C workbench push --porcelain origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option old-oid <COMMIT-A>
remote: proc-receive> option new-oid <COMMIT-B>
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option refname refs/changes/24/124/1
remote: proc-receive> option old-oid <ZERO-OID>
remote: proc-receive> option new-oid <COMMIT-A>
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option refname refs/changes/25/125/1
remote: proc-receive> option old-oid <COMMIT-A>
remote: proc-receive> option new-oid <COMMIT-B>
remote: # post-receive hook
- remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/24/124/1
remote: post-receive< <COMMIT-A> <COMMIT-B> refs/changes/25/125/1
To <URL/of/upstream.git>
- HEAD:refs/for/master/topic <OID-A>..<OID-B>
+ HEAD:refs/for/main/topic <OID-A>..<OID-B>
* HEAD:refs/changes/24/124/1 [new reference]
HEAD:refs/changes/25/125/1 <OID-A>..<OID-B>
Done
@@ -54,7 +54,7 @@ test_expect_success "proc-receive: multiple rewrite for one ref, no refname for
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
@@ -63,14 +63,14 @@ test_expect_success "setup proc-receive hook (multiple rewrites for one ref, no
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option refname refs/changes/24/124/1" \
-r "option old-oid $ZERO_OID" \
-r "option new-oid $A" \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option old-oid $A" \
-r "option new-oid $B" \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option refname refs/changes/25/125/1" \
-r "option old-oid $B" \
-r "option new-oid $A" \
@@ -78,38 +78,38 @@ test_expect_success "setup proc-receive hook (multiple rewrites for one ref, no
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/main/topic(A)
test_expect_success "proc-receive: multiple rewrites for one ref, no refname for the 2nd rewrite ($PROTOCOL/porcelain)" '
git -C workbench push --porcelain origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option refname refs/changes/24/124/1
remote: proc-receive> option old-oid <ZERO-OID>
remote: proc-receive> option new-oid <COMMIT-A>
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option old-oid <COMMIT-A>
remote: proc-receive> option new-oid <COMMIT-B>
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option refname refs/changes/25/125/1
remote: proc-receive> option old-oid <COMMIT-B>
remote: proc-receive> option new-oid <COMMIT-A>
remote: proc-receive> option forced-update
remote: # post-receive hook
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/24/124/1
- remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic
remote: post-receive< <COMMIT-B> <COMMIT-A> refs/changes/25/125/1
To <URL/of/upstream.git>
* HEAD:refs/changes/24/124/1 [new reference]
- HEAD:refs/for/master/topic <OID-A>..<OID-B>
+ HEAD:refs/for/main/topic <OID-A>..<OID-B>
+ HEAD:refs/changes/25/125/1 <OID-B>...<OID-A> (forced update)
Done
EOF
@@ -117,7 +117,7 @@ test_expect_success "proc-receive: multiple rewrites for one ref, no refname for
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
@@ -126,31 +126,31 @@ test_expect_success "setup proc-receive hook (multiple rewrites for one ref, $PR
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option refname refs/changes/23/123/1" \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option refname refs/changes/24/124/2" \
-r "option old-oid $A" \
-r "option new-oid $B"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : refs/for/main/topic(A)
test_expect_success "proc-receive: multiple rewrites for one ref ($PROTOCOL/porcelain)" '
git -C workbench push --porcelain origin \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: # proc-receive hook
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option refname refs/changes/23/123/1
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option refname refs/changes/24/124/2
remote: proc-receive> option old-oid <COMMIT-A>
remote: proc-receive> option new-oid <COMMIT-B>
@@ -166,7 +166,7 @@ test_expect_success "proc-receive: multiple rewrites for one ref ($PROTOCOL/porc
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
diff --git a/t/t5411/test-0038-report-mixed-refs.sh b/t/t5411/test-0038-report-mixed-refs.sh
index a74a2cb..0d071eb 100644
--- a/t/t5411/test-0038-report-mixed-refs.sh
+++ b/t/t5411/test-0038-report-mixed-refs.sh
@@ -4,63 +4,63 @@ test_expect_success "setup proc-receive hook ($PROTOCOL)" '
test-tool proc-receive -v \
-r "ok refs/for/next/topic2" \
-r "ng refs/for/next/topic1 fail to call Web API" \
- -r "ok refs/for/master/topic" \
- -r "option refname refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
+ -r "option refname refs/for/main/topic" \
-r "option old-oid $A" \
-r "option new-oid $B"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : (B) bar(A) baz(A) refs/for/next/topic(A) foo(A) refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : (B) bar(A) baz(A) refs/for/next/topic(A) foo(A) refs/for/main/topic(A)
test_expect_success "proc-receive: report update of mixed refs ($PROTOCOL)" '
test_must_fail git -C workbench push origin \
- $B:refs/heads/master \
+ $B:refs/heads/main \
HEAD:refs/heads/bar \
HEAD:refs/heads/baz \
HEAD:refs/for/next/topic2 \
HEAD:refs/for/next/topic1 \
HEAD:refs/heads/foo \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
HEAD:refs/for/next/topic3 \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+ remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/bar
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/baz
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic1
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic3
remote: # proc-receive hook
remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2
remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic1
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic3
remote: proc-receive> ok refs/for/next/topic2
remote: proc-receive> ng refs/for/next/topic1 fail to call Web API
- remote: proc-receive> ok refs/for/master/topic
- remote: proc-receive> option refname refs/for/master/topic
+ remote: proc-receive> ok refs/for/main/topic
+ remote: proc-receive> option refname refs/for/main/topic
remote: proc-receive> option old-oid <COMMIT-A>
remote: proc-receive> option new-oid <COMMIT-B>
remote: # post-receive hook
- remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/bar
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/baz
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo
- remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic
To <URL/of/upstream.git>
- <OID-A>..<OID-B> <COMMIT-B> -> master
+ <OID-A>..<OID-B> <COMMIT-B> -> main
* [new branch] HEAD -> bar
* [new branch] HEAD -> baz
* [new reference] HEAD -> refs/for/next/topic2
* [new branch] HEAD -> foo
- <OID-A>..<OID-B> HEAD -> refs/for/master/topic
+ <OID-A>..<OID-B> HEAD -> refs/for/main/topic
! [remote rejected] HEAD -> refs/for/next/topic1 (fail to call Web API)
! [remote rejected] HEAD -> refs/for/next/topic3 (proc-receive failed to report status)
EOF
@@ -71,17 +71,17 @@ test_expect_success "proc-receive: report update of mixed refs ($PROTOCOL)" '
<COMMIT-A> refs/heads/bar
<COMMIT-A> refs/heads/baz
<COMMIT-A> refs/heads/foo
- <COMMIT-B> refs/heads/master
+ <COMMIT-B> refs/heads/main
EOF
test_cmp expect actual
'
-# Refs of upstream : master(B) foo(A) bar(A)) baz(A)
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(B) foo(A) bar(A)) baz(A)
+# Refs of workbench: main(A) tags/v123
test_expect_success "cleanup ($PROTOCOL)" '
(
cd "$upstream" &&
- git update-ref refs/heads/master $A &&
+ git update-ref refs/heads/main $A &&
git update-ref -d refs/heads/foo &&
git update-ref -d refs/heads/bar &&
git update-ref -d refs/heads/baz
diff --git a/t/t5411/test-0039-report-mixed-refs--porcelain.sh b/t/t5411/test-0039-report-mixed-refs--porcelain.sh
index e4baa13..d840991 100644
--- a/t/t5411/test-0039-report-mixed-refs--porcelain.sh
+++ b/t/t5411/test-0039-report-mixed-refs--porcelain.sh
@@ -4,63 +4,63 @@ test_expect_success "setup proc-receive hook ($PROTOCOL/porcelain)" '
test-tool proc-receive -v \
-r "ok refs/for/next/topic2" \
-r "ng refs/for/next/topic1 fail to call Web API" \
- -r "ok refs/for/master/topic" \
- -r "option refname refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
+ -r "option refname refs/for/main/topic" \
-r "option old-oid $A" \
-r "option new-oid $B"
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : (B) bar(A) baz(A) refs/for/next/topic(A) foo(A) refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : (B) bar(A) baz(A) refs/for/next/topic(A) foo(A) refs/for/main/topic(A)
test_expect_success "proc-receive: report update of mixed refs ($PROTOCOL/porcelain)" '
test_must_fail git -C workbench push --porcelain origin \
- $B:refs/heads/master \
+ $B:refs/heads/main \
HEAD:refs/heads/bar \
HEAD:refs/heads/baz \
HEAD:refs/for/next/topic2 \
HEAD:refs/for/next/topic1 \
HEAD:refs/heads/foo \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
HEAD:refs/for/next/topic3 \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+ remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/bar
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/baz
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic1
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic3
remote: # proc-receive hook
remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2
remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic1
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic3
remote: proc-receive> ok refs/for/next/topic2
remote: proc-receive> ng refs/for/next/topic1 fail to call Web API
- remote: proc-receive> ok refs/for/master/topic
- remote: proc-receive> option refname refs/for/master/topic
+ remote: proc-receive> ok refs/for/main/topic
+ remote: proc-receive> option refname refs/for/main/topic
remote: proc-receive> option old-oid <COMMIT-A>
remote: proc-receive> option new-oid <COMMIT-B>
remote: # post-receive hook
- remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/bar
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/baz
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo
- remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic
To <URL/of/upstream.git>
- <COMMIT-B>:refs/heads/master <OID-A>..<OID-B>
+ <COMMIT-B>:refs/heads/main <OID-A>..<OID-B>
* HEAD:refs/heads/bar [new branch]
* HEAD:refs/heads/baz [new branch]
* HEAD:refs/for/next/topic2 [new reference]
* HEAD:refs/heads/foo [new branch]
- HEAD:refs/for/master/topic <OID-A>..<OID-B>
+ HEAD:refs/for/main/topic <OID-A>..<OID-B>
! HEAD:refs/for/next/topic1 [remote rejected] (fail to call Web API)
! HEAD:refs/for/next/topic3 [remote rejected] (proc-receive failed to report status)
Done
@@ -72,17 +72,17 @@ test_expect_success "proc-receive: report update of mixed refs ($PROTOCOL/porcel
<COMMIT-A> refs/heads/bar
<COMMIT-A> refs/heads/baz
<COMMIT-A> refs/heads/foo
- <COMMIT-B> refs/heads/master
+ <COMMIT-B> refs/heads/main
EOF
test_cmp expect actual
'
-# Refs of upstream : master(B) foo(A) bar(A)) baz(A)
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(B) foo(A) bar(A)) baz(A)
+# Refs of workbench: main(A) tags/v123
test_expect_success "cleanup ($PROTOCOL/porcelain)" '
(
cd "$upstream" &&
- git update-ref refs/heads/master $A &&
+ git update-ref refs/heads/main $A &&
git update-ref -d refs/heads/foo &&
git update-ref -d refs/heads/bar &&
git update-ref -d refs/heads/baz
diff --git a/t/t5411/test-0040-process-all-refs.sh b/t/t5411/test-0040-process-all-refs.sh
index b07c999..2565302 100644
--- a/t/t5411/test-0040-process-all-refs.sh
+++ b/t/t5411/test-0040-process-all-refs.sh
@@ -3,12 +3,12 @@ test_expect_success "config receive.procReceiveRefs = refs ($PROTOCOL)" '
git -C "$upstream" config --add receive.procReceiveRefs refs
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
test_expect_success "setup upstream branches ($PROTOCOL)" '
(
cd "$upstream" &&
- git update-ref refs/heads/master $B &&
+ git update-ref refs/heads/main $B &&
git update-ref refs/heads/foo $A &&
git update-ref refs/heads/bar $A &&
git update-ref refs/heads/baz $A
@@ -20,13 +20,13 @@ test_expect_success "setup proc-receive hook ($PROTOCOL)" '
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/heads/master" \
+ -r "ok refs/heads/main" \
-r "option fall-through" \
-r "ok refs/heads/foo" \
-r "option fall-through" \
-r "ok refs/heads/bar" \
-r "option fall-through" \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option refname refs/pull/123/head" \
-r "option old-oid $A" \
-r "option new-oid $B" \
@@ -38,15 +38,15 @@ test_expect_success "setup proc-receive hook ($PROTOCOL)" '
EOF
'
-# Refs of upstream : master(B) foo(A) bar(A)) baz(A)
-# Refs of workbench: master(A) tags/v123
-# git push -f : master(A) (NULL) (B) refs/for/master/topic(A) refs/for/next/topic(A)
+# Refs of upstream : main(B) foo(A) bar(A)) baz(A)
+# Refs of workbench: main(A) tags/v123
+# git push -f : main(A) (NULL) (B) refs/for/main/topic(A) refs/for/next/topic(A)
test_expect_success "proc-receive: process all refs ($PROTOCOL)" '
git -C workbench push -f origin \
- HEAD:refs/heads/master \
+ HEAD:refs/heads/main \
:refs/heads/foo \
$B:refs/heads/bar \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
HEAD:refs/for/next/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
@@ -54,22 +54,22 @@ test_expect_success "proc-receive: process all refs ($PROTOCOL)" '
remote: # pre-receive hook
remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar
remote: pre-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo
- remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/master
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/main
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
remote: # proc-receive hook
remote: proc-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar
remote: proc-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo
- remote: proc-receive< <COMMIT-B> <COMMIT-A> refs/heads/master
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: proc-receive< <COMMIT-B> <COMMIT-A> refs/heads/main
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
- remote: proc-receive> ok refs/heads/master
+ remote: proc-receive> ok refs/heads/main
remote: proc-receive> option fall-through
remote: proc-receive> ok refs/heads/foo
remote: proc-receive> option fall-through
remote: proc-receive> ok refs/heads/bar
remote: proc-receive> option fall-through
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option refname refs/pull/123/head
remote: proc-receive> option old-oid <COMMIT-A>
remote: proc-receive> option new-oid <COMMIT-B>
@@ -81,13 +81,13 @@ test_expect_success "proc-receive: process all refs ($PROTOCOL)" '
remote: # post-receive hook
remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar
remote: post-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo
- remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/master
+ remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/main
remote: post-receive< <COMMIT-A> <COMMIT-B> refs/pull/123/head
remote: post-receive< <COMMIT-B> <COMMIT-A> refs/pull/124/head
To <URL/of/upstream.git>
<OID-A>..<OID-B> <COMMIT-B> -> bar
- [deleted] foo
- + <OID-B>...<OID-A> HEAD -> master (forced update)
+ + <OID-B>...<OID-A> HEAD -> main (forced update)
<OID-A>..<OID-B> HEAD -> refs/pull/123/head
+ <OID-B>...<OID-A> HEAD -> refs/pull/124/head (forced update)
EOF
@@ -97,13 +97,13 @@ test_expect_success "proc-receive: process all refs ($PROTOCOL)" '
cat >expect <<-EOF &&
<COMMIT-B> refs/heads/bar
<COMMIT-A> refs/heads/baz
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
-# Refs of upstream : master(A) bar(A) baz(B)
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(A) bar(A) baz(B)
+# Refs of workbench: main(A) tags/v123
test_expect_success "cleanup ($PROTOCOL)" '
(
cd "$upstream" &&
diff --git a/t/t5411/test-0041-process-all-refs--porcelain.sh b/t/t5411/test-0041-process-all-refs--porcelain.sh
index 0dd9824..e21420b 100644
--- a/t/t5411/test-0041-process-all-refs--porcelain.sh
+++ b/t/t5411/test-0041-process-all-refs--porcelain.sh
@@ -3,12 +3,12 @@ test_expect_success "config receive.procReceiveRefs = refs ($PROTOCOL/porcelain)
git -C "$upstream" config --add receive.procReceiveRefs refs
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
test_expect_success "setup upstream branches ($PROTOCOL/porcelain)" '
(
cd "$upstream" &&
- git update-ref refs/heads/master $B &&
+ git update-ref refs/heads/main $B &&
git update-ref refs/heads/foo $A &&
git update-ref refs/heads/bar $A &&
git update-ref refs/heads/baz $A
@@ -20,13 +20,13 @@ test_expect_success "setup proc-receive hook ($PROTOCOL/porcelain)" '
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/heads/master" \
+ -r "ok refs/heads/main" \
-r "option fall-through" \
-r "ok refs/heads/foo" \
-r "option fall-through" \
-r "ok refs/heads/bar" \
-r "option fall-through" \
- -r "ok refs/for/master/topic" \
+ -r "ok refs/for/main/topic" \
-r "option refname refs/pull/123/head" \
-r "option old-oid $A" \
-r "option new-oid $B" \
@@ -38,15 +38,15 @@ test_expect_success "setup proc-receive hook ($PROTOCOL/porcelain)" '
EOF
'
-# Refs of upstream : master(B) foo(A) bar(A)) baz(A)
-# Refs of workbench: master(A) tags/v123
-# git push -f : master(A) (NULL) (B) refs/for/master/topic(A) refs/for/next/topic(A)
+# Refs of upstream : main(B) foo(A) bar(A)) baz(A)
+# Refs of workbench: main(A) tags/v123
+# git push -f : main(A) (NULL) (B) refs/for/main/topic(A) refs/for/next/topic(A)
test_expect_success "proc-receive: process all refs ($PROTOCOL/porcelain)" '
git -C workbench push --porcelain -f origin \
- HEAD:refs/heads/master \
+ HEAD:refs/heads/main \
:refs/heads/foo \
$B:refs/heads/bar \
- HEAD:refs/for/master/topic \
+ HEAD:refs/for/main/topic \
HEAD:refs/for/next/topic \
>out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
@@ -54,22 +54,22 @@ test_expect_success "proc-receive: process all refs ($PROTOCOL/porcelain)" '
remote: # pre-receive hook
remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar
remote: pre-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo
- remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/master
- remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/main
+ remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
remote: # proc-receive hook
remote: proc-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar
remote: proc-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo
- remote: proc-receive< <COMMIT-B> <COMMIT-A> refs/heads/master
- remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: proc-receive< <COMMIT-B> <COMMIT-A> refs/heads/main
+ remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
- remote: proc-receive> ok refs/heads/master
+ remote: proc-receive> ok refs/heads/main
remote: proc-receive> option fall-through
remote: proc-receive> ok refs/heads/foo
remote: proc-receive> option fall-through
remote: proc-receive> ok refs/heads/bar
remote: proc-receive> option fall-through
- remote: proc-receive> ok refs/for/master/topic
+ remote: proc-receive> ok refs/for/main/topic
remote: proc-receive> option refname refs/pull/123/head
remote: proc-receive> option old-oid <COMMIT-A>
remote: proc-receive> option new-oid <COMMIT-B>
@@ -81,13 +81,13 @@ test_expect_success "proc-receive: process all refs ($PROTOCOL/porcelain)" '
remote: # post-receive hook
remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar
remote: post-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo
- remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/master
+ remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/main
remote: post-receive< <COMMIT-A> <COMMIT-B> refs/pull/123/head
remote: post-receive< <COMMIT-B> <COMMIT-A> refs/pull/124/head
To <URL/of/upstream.git>
<COMMIT-B>:refs/heads/bar <OID-A>..<OID-B>
- :refs/heads/foo [deleted]
- + HEAD:refs/heads/master <OID-B>...<OID-A> (forced update)
+ + HEAD:refs/heads/main <OID-B>...<OID-A> (forced update)
HEAD:refs/pull/123/head <OID-A>..<OID-B>
+ HEAD:refs/pull/124/head <OID-B>...<OID-A> (forced update)
Done
@@ -98,13 +98,13 @@ test_expect_success "proc-receive: process all refs ($PROTOCOL/porcelain)" '
cat >expect <<-EOF &&
<COMMIT-B> refs/heads/bar
<COMMIT-A> refs/heads/baz
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
-# Refs of upstream : master(A) bar(A) baz(B)
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(A) bar(A) baz(B)
+# Refs of workbench: main(A) tags/v123
test_expect_success "cleanup ($PROTOCOL/porcelain)" '
(
cd "$upstream" &&
diff --git a/t/t5411/test-0050-proc-receive-refs-with-modifiers.sh b/t/t5411/test-0050-proc-receive-refs-with-modifiers.sh
index c22849c..2e29518 100644
--- a/t/t5411/test-0050-proc-receive-refs-with-modifiers.sh
+++ b/t/t5411/test-0050-proc-receive-refs-with-modifiers.sh
@@ -2,7 +2,7 @@ test_expect_success "config receive.procReceiveRefs with modifiers ($PROTOCOL)"
(
cd "$upstream" &&
git config --unset-all receive.procReceiveRefs &&
- git config --add receive.procReceiveRefs m:refs/heads/master &&
+ git config --add receive.procReceiveRefs m:refs/heads/main &&
git config --add receive.procReceiveRefs ad:refs/heads &&
git config --add receive.procReceiveRefs "a!:refs/heads"
)
@@ -12,7 +12,7 @@ test_expect_success "setup proc-receive hook ($PROTOCOL)" '
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/heads/master" \
+ -r "ok refs/heads/main" \
-r "option refname refs/pull/123/head" \
-r "option old-oid $A" \
-r "option new-oid $B" \
@@ -21,22 +21,22 @@ test_expect_success "setup proc-receive hook ($PROTOCOL)" '
EOF
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
-# git push : master(B) tags/v123
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
+# git push : main(B) tags/v123
test_expect_success "proc-receive: update branch and new tag ($PROTOCOL)" '
git -C workbench push origin \
- $B:refs/heads/master \
+ $B:refs/heads/main \
v123 >out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+ remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
remote: pre-receive< <ZERO-OID> <TAG-v123> refs/tags/v123
remote: # proc-receive hook
- remote: proc-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+ remote: proc-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
remote: proc-receive< <ZERO-OID> <TAG-v123> refs/tags/v123
- remote: proc-receive> ok refs/heads/master
+ remote: proc-receive> ok refs/heads/main
remote: proc-receive> option refname refs/pull/123/head
remote: proc-receive> option old-oid <COMMIT-A>
remote: proc-receive> option new-oid <COMMIT-B>
@@ -53,20 +53,20 @@ test_expect_success "proc-receive: update branch and new tag ($PROTOCOL)" '
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
EOF
test_cmp expect actual
'
-# Refs of upstream : master(A)
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(A)
+# Refs of workbench: main(A) tags/v123
test_expect_success "setup upstream: create tags/v123 ($PROTOCOL)" '
git -C "$upstream" update-ref refs/heads/topic $A &&
git -C "$upstream" update-ref refs/tags/v123 $TAG &&
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
<COMMIT-A> refs/heads/topic
<TAG-v123> refs/tags/v123
EOF
@@ -77,7 +77,7 @@ test_expect_success "setup proc-receive hook ($PROTOCOL)" '
write_script "$upstream/hooks/proc-receive" <<-EOF
printf >&2 "# proc-receive hook\n"
test-tool proc-receive -v \
- -r "ok refs/heads/master" \
+ -r "ok refs/heads/main" \
-r "option refname refs/pull/123/head" \
-r "option old-oid $A" \
-r "option new-oid $ZERO_OID" \
@@ -87,26 +87,26 @@ test_expect_success "setup proc-receive hook ($PROTOCOL)" '
EOF
'
-# Refs of upstream : master(A) topic(A) tags/v123
-# Refs of workbench: master(A) tags/v123
+# Refs of upstream : main(A) topic(A) tags/v123
+# Refs of workbench: main(A) tags/v123
# git push : NULL topic(B) NULL next(A)
test_expect_success "proc-receive: create/delete branch, and delete tag ($PROTOCOL)" '
git -C workbench push origin \
- :refs/heads/master \
+ :refs/heads/main \
$B:refs/heads/topic \
$A:refs/heads/next \
:refs/tags/v123 >out 2>&1 &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
remote: # pre-receive hook
- remote: pre-receive< <COMMIT-A> <ZERO-OID> refs/heads/master
+ remote: pre-receive< <COMMIT-A> <ZERO-OID> refs/heads/main
remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/topic
remote: pre-receive< <TAG-v123> <ZERO-OID> refs/tags/v123
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
remote: # proc-receive hook
- remote: proc-receive< <COMMIT-A> <ZERO-OID> refs/heads/master
+ remote: proc-receive< <COMMIT-A> <ZERO-OID> refs/heads/main
remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
- remote: proc-receive> ok refs/heads/master
+ remote: proc-receive> ok refs/heads/main
remote: proc-receive> option refname refs/pull/123/head
remote: proc-receive> option old-oid <COMMIT-A>
remote: proc-receive> option new-oid <ZERO-OID>
@@ -128,7 +128,7 @@ test_expect_success "proc-receive: create/delete branch, and delete tag ($PROTOC
git -C "$upstream" show-ref >out &&
make_user_friendly_and_stable_output <out >actual &&
cat >expect <<-EOF &&
- <COMMIT-A> refs/heads/master
+ <COMMIT-A> refs/heads/main
<COMMIT-B> refs/heads/topic
EOF
test_cmp expect actual
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index 8d62edd..eaa6e90 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -145,8 +145,8 @@ test_expect_success 'remove remote protects local branches' '
test_expect_success 'remove errors out early when deleting non-existent branch' '
(
cd test &&
- echo "fatal: No such remote: '\''foo'\''" >expect &&
- test_must_fail git remote rm foo 2>actual &&
+ echo "error: No such remote: '\''foo'\''" >expect &&
+ test_expect_code 2 git remote rm foo 2>actual &&
test_i18ncmp expect actual
)
'
@@ -173,24 +173,37 @@ test_expect_success 'remove remote with a branch without configured merge' '
test_expect_success 'rename errors out early when deleting non-existent branch' '
(
cd test &&
- echo "fatal: No such remote: '\''foo'\''" >expect &&
- test_must_fail git remote rename foo bar 2>actual &&
+ echo "error: No such remote: '\''foo'\''" >expect &&
+ test_expect_code 2 git remote rename foo bar 2>actual &&
test_i18ncmp expect actual
)
'
+test_expect_success 'rename errors out early when when new name is invalid' '
+ test_config remote.foo.vcs bar &&
+ echo "fatal: '\''invalid...name'\'' is not a valid remote name" >expect &&
+ test_must_fail git remote rename foo invalid...name 2>actual &&
+ test_i18ncmp expect actual
+'
+
test_expect_success 'add existing foreign_vcs remote' '
test_config remote.foo.vcs bar &&
- echo "fatal: remote foo already exists." >expect &&
- test_must_fail git remote add foo bar 2>actual &&
+ echo "error: remote foo already exists." >expect &&
+ test_expect_code 3 git remote add foo bar 2>actual &&
test_i18ncmp expect actual
'
test_expect_success 'add existing foreign_vcs remote' '
test_config remote.foo.vcs bar &&
test_config remote.bar.vcs bar &&
- echo "fatal: remote bar already exists." >expect &&
- test_must_fail git remote rename foo bar 2>actual &&
+ echo "error: remote bar already exists." >expect &&
+ test_expect_code 3 git remote rename foo bar 2>actual &&
+ test_i18ncmp expect actual
+'
+
+test_expect_success 'add invalid foreign_vcs remote' '
+ echo "fatal: '\''invalid...name'\'' is not a valid remote name" >expect &&
+ test_must_fail git remote add invalid...name bar 2>actual &&
test_i18ncmp expect actual
'
@@ -200,28 +213,28 @@ cat >test/expect <<EOF
Push URL: $(pwd)/one
HEAD branch: master
Remote branches:
- master new (next fetch will store in remotes/origin)
- side tracked
+ main new (next fetch will store in remotes/origin)
+ side tracked
Local branches configured for 'git pull':
- ahead merges with remote master
- master merges with remote master
+ ahead merges with remote main
+ main merges with remote main
octopus merges with remote topic-a
and with remote topic-b
and with remote topic-c
rebase rebases onto remote master
Local refs configured for 'git push':
- master pushes to master (local out of date)
- master pushes to upstream (create)
+ main pushes to main (local out of date)
+ main pushes to upstream (create)
* remote two
Fetch URL: ../two
Push URL: ../three
HEAD branch: master
Local refs configured for 'git push':
- ahead forces to master (fast-forwardable)
- master pushes to another (up to date)
+ ahead forces to main (fast-forwardable)
+ main pushes to another (up to date)
EOF
-test_expect_success 'show' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'show' '
(
cd test &&
git config --add remote.origin.fetch refs/heads/master:refs/heads/upstream &&
@@ -264,15 +277,15 @@ cat >test/expect <<EOF
master
side
Local branches configured for 'git pull':
- ahead merges with remote master
- master merges with remote master
+ ahead merges with remote main
+ main merges with remote main
Local refs configured for 'git push' (status not queried):
(matching) pushes to (matching)
- refs/heads/master pushes to refs/heads/upstream
+ refs/heads/main pushes to refs/heads/upstream
refs/tags/lastbackup forces to refs/tags/lastbackup
EOF
-test_expect_success 'show -n' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'show -n' '
mv one one.unreachable &&
(
cd test &&
@@ -315,7 +328,7 @@ test_expect_success 'set-head --auto' '
)
'
-test_expect_success 'set-head --auto has no problem w/multiple HEADs' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'set-head --auto has no problem w/multiple HEADs' '
(
cd test &&
git fetch two "refs/heads/*:refs/remotes/two/*" &&
@@ -1335,7 +1348,7 @@ test_expect_success 'unqualified <dst> refspec DWIM and advice' '
)
'
-test_expect_success 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' '
(
cd two &&
git tag -a -m "Some tag" my-tag master &&
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index dbc724e..5d67335 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -942,7 +942,7 @@ test_expect_success 'fetching with auto-gc does not lock up' '
)
'
-test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch aligned output' '
git clone . full-output &&
test_commit looooooooooooong-tag &&
(
@@ -951,13 +951,13 @@ test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' '
grep -e "->" actual | cut -c 22- >../actual
) &&
cat >expect <<-\EOF &&
- master -> origin/master
+ main -> origin/main
looooooooooooong-tag -> looooooooooooong-tag
EOF
test_cmp expect actual
'
-test_expect_success C_LOCALE_OUTPUT 'fetch compact output' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch compact output' '
git clone . compact &&
test_commit extraaa &&
(
@@ -966,7 +966,7 @@ test_expect_success C_LOCALE_OUTPUT 'fetch compact output' '
grep -e "->" actual | cut -c 22- >../actual
) &&
cat >expect <<-\EOF &&
- master -> origin/*
+ main -> origin/*
extraaa -> *
EOF
test_cmp expect actual
diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh
index 70a9d2d..50f1410 100755
--- a/t/t5515-fetch-merge-logic.sh
+++ b/t/t5515-fetch-merge-logic.sh
@@ -11,11 +11,14 @@ test_description='Merge logic in fetch'
GIT_TEST_PROTOCOL_VERSION=0
export GIT_TEST_PROTOCOL_VERSION
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
. ./test-lib.sh
build_script () {
script="$1" &&
- for i in one three_file master topic_2 one_tree three two two2 three2
+ for i in one three_file main topic_2 one_tree three two two2 three2
do
echo "s/$(test_oid --hash=sha1 "$i")/$(test_oid "$i")/g" >>"$script"
done
@@ -40,8 +43,8 @@ test_expect_success setup '
three_file sha1:0e3b14047d3ee365f4f2a1b673db059c3972589c
three_file sha256:bc4447d50c07497a8bfe6eef817f2364ecca9d471452e43b52756cc1a908bd32
- master sha1:6c9dec2b923228c9ff994c6cfe4ae16c12408dc5
- master sha256:8521c3072461fcfe8f32d67f95cc6e6b832a2db2fa29769ffc788bce85ebcd75
+ main sha1:ecf3b3627b498bdcb735cc4343bf165f76964e9a
+ main sha256:fff666109892bb4b1c80cd1649d2d8762a0663db8b5d46c8be98360b64fbba5f
one_tree sha1:22feea448b023a2d864ef94b013735af34d238ba
one_tree sha256:6e4743f4ef2356b881dda5e91f5c7cdffe870faf350bf7b312f80a20935f5d83
@@ -52,8 +55,8 @@ test_expect_success setup '
two sha1:525b7fb068d59950d185a8779dc957c77eed73ba
two sha256:3b21de3440cd38c2a9e9b464adb923f7054949ed4c918e1a0ac4c95cd52774db
- topic_2 sha1:754b754407bf032e9a2f9d5a9ad05ca79a6b228f
- topic_2 sha256:6c7abaea8a6d8ef4d89877e68462758dc6774690fbbbb0e6d7dd57415c9abde0
+ topic_2 sha1:b4ab76b1a01ea602209932134a44f1e6bd610832
+ topic_2 sha256:380ebae0113f877ce46fcdf39d5bc33e4dc0928db5c5a4d5fdc78381c4d55ae3
two2 sha1:6134ee8f857693b96ff1cc98d3e2fd62b199e5a8
two2 sha256:87a2d3ee29c83a3dc7afd41c0606b11f67603120b910a7be7840accdc18344d4
@@ -80,9 +83,9 @@ test_expect_success setup '
git tag -a -m "Tag Three file" tag-three-file HEAD^{tree}:file &&
git branch three &&
- echo master >> file &&
- git commit -a -m Master &&
- git tag -a -m "Tag Master" tag-master &&
+ echo main >> file &&
+ git commit -a -m Main &&
+ git tag -a -m "Tag Main" tag-main &&
git checkout three &&
@@ -91,7 +94,7 @@ test_expect_success setup '
git config remote.origin.url ../.git/ &&
git config remote.config-explicit.url ../.git/ &&
- git config remote.config-explicit.fetch refs/heads/master:remotes/rem/master &&
+ git config remote.config-explicit.fetch refs/heads/main:remotes/rem/main &&
git config --add remote.config-explicit.fetch refs/heads/one:remotes/rem/one &&
git config --add remote.config-explicit.fetch two:remotes/rem/two &&
git config --add remote.config-explicit.fetch refs/heads/three:remotes/rem/three &&
@@ -104,7 +107,7 @@ test_expect_success setup '
mkdir -p .git/remotes &&
{
echo "URL: ../.git/"
- echo "Pull: refs/heads/master:remotes/rem/master"
+ echo "Pull: refs/heads/main:remotes/rem/main"
echo "Pull: refs/heads/one:remotes/rem/one"
echo "Pull: two:remotes/rem/two"
echo "Pull: refs/heads/three:remotes/rem/three"
@@ -149,7 +152,7 @@ done > tests
# but does depend on Pull: or fetch lines.
# Use two branches completely unrelated from the arguments,
# the clone default and one without branch properties
-for branch in master br-unconfig ; do
+for branch in main br-unconfig ; do
echo $branch
for remote in $remotes ; do
echo $branch $remote
@@ -158,7 +161,7 @@ done >> tests
# Merge logic does not depend on branch properties
# neither in the Pull: or .fetch config
-for branch in master br-unconfig ; do
+for branch in main br-unconfig ; do
cat <<EOF
$branch ../.git
$branch ../.git one
diff --git a/t/t5515/fetch.br-branches-default b/t/t5515/fetch.br-branches-default
index a1bc3d5..0bed09c 100644
--- a/t/t5515/fetch.br-branches-default
+++ b/t/t5515/fetch.br-branches-default
@@ -1,6 +1,6 @@
# br-branches-default
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 branch 'main' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-branches-default-merge b/t/t5515/fetch.br-branches-default-merge
index 12ab08e..59eef63 100644
--- a/t/t5515/fetch.br-branches-default-merge
+++ b/t/t5515/fetch.br-branches-default-merge
@@ -1,7 +1,7 @@
# br-branches-default-merge
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-branches-default-merge_branches-default b/t/t5515/fetch.br-branches-default-merge_branches-default
index 5442752..490186c 100644
--- a/t/t5515/fetch.br-branches-default-merge_branches-default
+++ b/t/t5515/fetch.br-branches-default-merge_branches-default
@@ -1,7 +1,7 @@
# br-branches-default-merge branches-default
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-branches-default-octopus b/t/t5515/fetch.br-branches-default-octopus
index 498a761..d484138 100644
--- a/t/t5515/fetch.br-branches-default-octopus
+++ b/t/t5515/fetch.br-branches-default-octopus
@@ -1,8 +1,8 @@
# br-branches-default-octopus
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-branches-default-octopus_branches-default b/t/t5515/fetch.br-branches-default-octopus_branches-default
index 0857f13..b79a5fe 100644
--- a/t/t5515/fetch.br-branches-default-octopus_branches-default
+++ b/t/t5515/fetch.br-branches-default-octopus_branches-default
@@ -1,8 +1,8 @@
# br-branches-default-octopus branches-default
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-branches-default_branches-default b/t/t5515/fetch.br-branches-default_branches-default
index 8cbd718..1c866d8 100644
--- a/t/t5515/fetch.br-branches-default_branches-default
+++ b/t/t5515/fetch.br-branches-default_branches-default
@@ -1,6 +1,6 @@
# br-branches-default branches-default
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 branch 'main' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-branches-one b/t/t5515/fetch.br-branches-one
index c98f670..6925a77 100644
--- a/t/t5515/fetch.br-branches-one
+++ b/t/t5515/fetch.br-branches-one
@@ -1,6 +1,6 @@
# br-branches-one
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-branches-one-merge b/t/t5515/fetch.br-branches-one-merge
index 54a7742..8525703 100644
--- a/t/t5515/fetch.br-branches-one-merge
+++ b/t/t5515/fetch.br-branches-one-merge
@@ -1,7 +1,7 @@
# br-branches-one-merge
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-branches-one-merge_branches-one b/t/t5515/fetch.br-branches-one-merge_branches-one
index b4d1bb0..3a63a7f 100644
--- a/t/t5515/fetch.br-branches-one-merge_branches-one
+++ b/t/t5515/fetch.br-branches-one-merge_branches-one
@@ -1,7 +1,7 @@
# br-branches-one-merge branches-one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-branches-one-octopus b/t/t5515/fetch.br-branches-one-octopus
index 97c4b54..46af763 100644
--- a/t/t5515/fetch.br-branches-one-octopus
+++ b/t/t5515/fetch.br-branches-one-octopus
@@ -1,7 +1,7 @@
# br-branches-one-octopus
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-branches-one-octopus_branches-one b/t/t5515/fetch.br-branches-one-octopus_branches-one
index df705f7..becfde9 100644
--- a/t/t5515/fetch.br-branches-one-octopus_branches-one
+++ b/t/t5515/fetch.br-branches-one-octopus_branches-one
@@ -1,7 +1,7 @@
# br-branches-one-octopus branches-one
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-branches-one_branches-one b/t/t5515/fetch.br-branches-one_branches-one
index 96890e5..9ba34c6 100644
--- a/t/t5515/fetch.br-branches-one_branches-one
+++ b/t/t5515/fetch.br-branches-one_branches-one
@@ -1,6 +1,6 @@
# br-branches-one branches-one
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-config-explicit b/t/t5515/fetch.br-config-explicit
index 68fc927..7466a73 100644
--- a/t/t5515/fetch.br-config-explicit
+++ b/t/t5515/fetch.br-config-explicit
@@ -1,9 +1,9 @@
# br-config-explicit
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-config-explicit-merge b/t/t5515/fetch.br-config-explicit-merge
index 5ce764a..9375b7d 100644
--- a/t/t5515/fetch.br-config-explicit-merge
+++ b/t/t5515/fetch.br-config-explicit-merge
@@ -1,9 +1,9 @@
# br-config-explicit-merge
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-config-explicit-merge_config-explicit b/t/t5515/fetch.br-config-explicit-merge_config-explicit
index b1152b7..6335e2b 100644
--- a/t/t5515/fetch.br-config-explicit-merge_config-explicit
+++ b/t/t5515/fetch.br-config-explicit-merge_config-explicit
@@ -1,9 +1,9 @@
# br-config-explicit-merge config-explicit
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-config-explicit-octopus b/t/t5515/fetch.br-config-explicit-octopus
index 110577b..c379aa9 100644
--- a/t/t5515/fetch.br-config-explicit-octopus
+++ b/t/t5515/fetch.br-config-explicit-octopus
@@ -1,9 +1,9 @@
# br-config-explicit-octopus
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-config-explicit-octopus_config-explicit b/t/t5515/fetch.br-config-explicit-octopus_config-explicit
index a29dd8b..7fb3a3e 100644
--- a/t/t5515/fetch.br-config-explicit-octopus_config-explicit
+++ b/t/t5515/fetch.br-config-explicit-octopus_config-explicit
@@ -1,9 +1,9 @@
# br-config-explicit-octopus config-explicit
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-config-explicit_config-explicit b/t/t5515/fetch.br-config-explicit_config-explicit
index b19b016..86045a7 100644
--- a/t/t5515/fetch.br-config-explicit_config-explicit
+++ b/t/t5515/fetch.br-config-explicit_config-explicit
@@ -1,9 +1,9 @@
# br-config-explicit config-explicit
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-config-glob b/t/t5515/fetch.br-config-glob
index 946d70c..bfeef2b 100644
--- a/t/t5515/fetch.br-config-glob
+++ b/t/t5515/fetch.br-config-glob
@@ -1,9 +1,9 @@
# br-config-glob
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-config-glob-merge b/t/t5515/fetch.br-config-glob-merge
index 89f2596..5376a4a 100644
--- a/t/t5515/fetch.br-config-glob-merge
+++ b/t/t5515/fetch.br-config-glob-merge
@@ -1,9 +1,9 @@
# br-config-glob-merge
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-config-glob-merge_config-glob b/t/t5515/fetch.br-config-glob-merge_config-glob
index 2ba4832..7dfc2fe 100644
--- a/t/t5515/fetch.br-config-glob-merge_config-glob
+++ b/t/t5515/fetch.br-config-glob-merge_config-glob
@@ -1,9 +1,9 @@
# br-config-glob-merge config-glob
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-config-glob-octopus b/t/t5515/fetch.br-config-glob-octopus
index 64994df..1084030 100644
--- a/t/t5515/fetch.br-config-glob-octopus
+++ b/t/t5515/fetch.br-config-glob-octopus
@@ -1,9 +1,9 @@
# br-config-glob-octopus
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-config-glob-octopus_config-glob b/t/t5515/fetch.br-config-glob-octopus_config-glob
index 681a725..839866d 100644
--- a/t/t5515/fetch.br-config-glob-octopus_config-glob
+++ b/t/t5515/fetch.br-config-glob-octopus_config-glob
@@ -1,9 +1,9 @@
# br-config-glob-octopus config-glob
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-config-glob_config-glob b/t/t5515/fetch.br-config-glob_config-glob
index 19daf0c..7b0cb91 100644
--- a/t/t5515/fetch.br-config-glob_config-glob
+++ b/t/t5515/fetch.br-config-glob_config-glob
@@ -1,9 +1,9 @@
# br-config-glob config-glob
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-remote-explicit b/t/t5515/fetch.br-remote-explicit
index ab44bc5..d6619e7 100644
--- a/t/t5515/fetch.br-remote-explicit
+++ b/t/t5515/fetch.br-remote-explicit
@@ -1,9 +1,9 @@
# br-remote-explicit
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-remote-explicit-merge b/t/t5515/fetch.br-remote-explicit-merge
index d018b35..5b49b7c 100644
--- a/t/t5515/fetch.br-remote-explicit-merge
+++ b/t/t5515/fetch.br-remote-explicit-merge
@@ -1,9 +1,9 @@
# br-remote-explicit-merge
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-remote-explicit-merge_remote-explicit b/t/t5515/fetch.br-remote-explicit-merge_remote-explicit
index 0d3d780..417261d 100644
--- a/t/t5515/fetch.br-remote-explicit-merge_remote-explicit
+++ b/t/t5515/fetch.br-remote-explicit-merge_remote-explicit
@@ -1,9 +1,9 @@
# br-remote-explicit-merge remote-explicit
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-remote-explicit-octopus b/t/t5515/fetch.br-remote-explicit-octopus
index 6f84304..2edef64 100644
--- a/t/t5515/fetch.br-remote-explicit-octopus
+++ b/t/t5515/fetch.br-remote-explicit-octopus
@@ -1,9 +1,9 @@
# br-remote-explicit-octopus
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-remote-explicit-octopus_remote-explicit b/t/t5515/fetch.br-remote-explicit-octopus_remote-explicit
index 3546a83..ceb8752 100644
--- a/t/t5515/fetch.br-remote-explicit-octopus_remote-explicit
+++ b/t/t5515/fetch.br-remote-explicit-octopus_remote-explicit
@@ -1,9 +1,9 @@
# br-remote-explicit-octopus remote-explicit
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-remote-explicit_remote-explicit b/t/t5515/fetch.br-remote-explicit_remote-explicit
index 01e014e..b7abbd2 100644
--- a/t/t5515/fetch.br-remote-explicit_remote-explicit
+++ b/t/t5515/fetch.br-remote-explicit_remote-explicit
@@ -1,9 +1,9 @@
# br-remote-explicit remote-explicit
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-remote-glob b/t/t5515/fetch.br-remote-glob
index 09bfcee..645412c 100644
--- a/t/t5515/fetch.br-remote-glob
+++ b/t/t5515/fetch.br-remote-glob
@@ -1,9 +1,9 @@
# br-remote-glob
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-remote-glob-merge b/t/t5515/fetch.br-remote-glob-merge
index 7e1a433..8512cfd 100644
--- a/t/t5515/fetch.br-remote-glob-merge
+++ b/t/t5515/fetch.br-remote-glob-merge
@@ -1,9 +1,9 @@
# br-remote-glob-merge
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-remote-glob-merge_remote-glob b/t/t5515/fetch.br-remote-glob-merge_remote-glob
index 53571bb..7394164 100644
--- a/t/t5515/fetch.br-remote-glob-merge_remote-glob
+++ b/t/t5515/fetch.br-remote-glob-merge_remote-glob
@@ -1,9 +1,9 @@
# br-remote-glob-merge remote-glob
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-remote-glob-octopus b/t/t5515/fetch.br-remote-glob-octopus
index c7c8b6d..0ca4719 100644
--- a/t/t5515/fetch.br-remote-glob-octopus
+++ b/t/t5515/fetch.br-remote-glob-octopus
@@ -1,9 +1,9 @@
# br-remote-glob-octopus
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-remote-glob-octopus_remote-glob b/t/t5515/fetch.br-remote-glob-octopus_remote-glob
index 36076fb..7e7b0ba 100644
--- a/t/t5515/fetch.br-remote-glob-octopus_remote-glob
+++ b/t/t5515/fetch.br-remote-glob-octopus_remote-glob
@@ -1,9 +1,9 @@
# br-remote-glob-octopus remote-glob
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-remote-glob_remote-glob b/t/t5515/fetch.br-remote-glob_remote-glob
index 20ba5cb..7bae5ec 100644
--- a/t/t5515/fetch.br-remote-glob_remote-glob
+++ b/t/t5515/fetch.br-remote-glob_remote-glob
@@ -1,9 +1,9 @@
# br-remote-glob remote-glob
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-unconfig b/t/t5515/fetch.br-unconfig
index 887ccfc..ccaa54f 100644
--- a/t/t5515/fetch.br-unconfig
+++ b/t/t5515/fetch.br-unconfig
@@ -1,9 +1,9 @@
# br-unconfig
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-unconfig_--tags_.._.git b/t/t5515/fetch.br-unconfig_--tags_.._.git
index 0f70f66..3afb4f8 100644
--- a/t/t5515/fetch.br-unconfig_--tags_.._.git
+++ b/t/t5515/fetch.br-unconfig_--tags_.._.git
@@ -1,6 +1,6 @@
# br-unconfig --tags ../.git
0567da4d5edd2ff4bb292a465ba9e64dcad9536b ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file b/t/t5515/fetch.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file
index 7411536..525713a 100644
--- a/t/t5515/fetch.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file
+++ b/t/t5515/fetch.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file
@@ -2,7 +2,7 @@
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 tag 'tag-one' of ../
0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
525b7fb068d59950d185a8779dc957c77eed73ba not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file b/t/t5515/fetch.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file
index 7726983..18c871f 100644
--- a/t/t5515/fetch.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file
+++ b/t/t5515/fetch.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file
@@ -1,7 +1,7 @@
# br-unconfig ../.git tag tag-one-tree tag tag-three-file
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
525b7fb068d59950d185a8779dc957c77eed73ba not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig_.._.git_tag_tag-one_tag_tag-three b/t/t5515/fetch.br-unconfig_.._.git_tag_tag-one_tag_tag-three
index 7b3750c..7328d30 100644
--- a/t/t5515/fetch.br-unconfig_.._.git_tag_tag-one_tag_tag-three
+++ b/t/t5515/fetch.br-unconfig_.._.git_tag_tag-one_tag_tag-three
@@ -1,7 +1,7 @@
# br-unconfig ../.git tag tag-one tag tag-three
8e32a6d901327a23ef831511badce7bf3bf46689 tag 'tag-one' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 tag 'tag-three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
525b7fb068d59950d185a8779dc957c77eed73ba not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig_branches-default b/t/t5515/fetch.br-unconfig_branches-default
index da30e3c..3d82f94 100644
--- a/t/t5515/fetch.br-unconfig_branches-default
+++ b/t/t5515/fetch.br-unconfig_branches-default
@@ -1,6 +1,6 @@
# br-unconfig branches-default
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 branch 'main' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-unconfig_branches-one b/t/t5515/fetch.br-unconfig_branches-one
index e461431..948ed0c 100644
--- a/t/t5515/fetch.br-unconfig_branches-one
+++ b/t/t5515/fetch.br-unconfig_branches-one
@@ -1,6 +1,6 @@
# br-unconfig branches-one
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-unconfig_config-explicit b/t/t5515/fetch.br-unconfig_config-explicit
index ed323c9..65aaec8 100644
--- a/t/t5515/fetch.br-unconfig_config-explicit
+++ b/t/t5515/fetch.br-unconfig_config-explicit
@@ -1,9 +1,9 @@
# br-unconfig config-explicit
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-unconfig_config-glob b/t/t5515/fetch.br-unconfig_config-glob
index 2372ed0..1aa3d45 100644
--- a/t/t5515/fetch.br-unconfig_config-glob
+++ b/t/t5515/fetch.br-unconfig_config-glob
@@ -1,9 +1,9 @@
# br-unconfig config-glob
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-unconfig_remote-explicit b/t/t5515/fetch.br-unconfig_remote-explicit
index 6318dd1..16438d2 100644
--- a/t/t5515/fetch.br-unconfig_remote-explicit
+++ b/t/t5515/fetch.br-unconfig_remote-explicit
@@ -1,9 +1,9 @@
# br-unconfig remote-explicit
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.br-unconfig_remote-glob b/t/t5515/fetch.br-unconfig_remote-glob
index 1d9afad..7a01d2e 100644
--- a/t/t5515/fetch.br-unconfig_remote-glob
+++ b/t/t5515/fetch.br-unconfig_remote-glob
@@ -1,9 +1,9 @@
# br-unconfig remote-glob
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.master b/t/t5515/fetch.main
index 9b29d67..819ed33 100644
--- a/t/t5515/fetch.master
+++ b/t/t5515/fetch.main
@@ -1,9 +1,9 @@
-# master
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+# main
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.master_--tags_.._.git b/t/t5515/fetch.main_--tags_.._.git
index ab473a6..ddf67a6 100644
--- a/t/t5515/fetch.master_--tags_.._.git
+++ b/t/t5515/fetch.main_--tags_.._.git
@@ -1,6 +1,6 @@
-# master --tags ../.git
+# main --tags ../.git
0567da4d5edd2ff4bb292a465ba9e64dcad9536b ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.master_.._.git b/t/t5515/fetch.main_.._.git
index 66d1aad..285e57e 100644
--- a/t/t5515/fetch.master_.._.git
+++ b/t/t5515/fetch.main_.._.git
@@ -1,2 +1,2 @@
-# master ../.git
+# main ../.git
0567da4d5edd2ff4bb292a465ba9e64dcad9536b ../
diff --git a/t/t5515/fetch.master_.._.git_one b/t/t5515/fetch.main_.._.git_one
index 35deddb..f9f511e 100644
--- a/t/t5515/fetch.master_.._.git_one
+++ b/t/t5515/fetch.main_.._.git_one
@@ -1,2 +1,2 @@
-# master ../.git one
+# main ../.git one
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
diff --git a/t/t5515/fetch.master_.._.git_one_tag_tag-one_tag_tag-three-file b/t/t5515/fetch.main_.._.git_one_tag_tag-one_tag_tag-three-file
index 0672d12..187643e 100644
--- a/t/t5515/fetch.master_.._.git_one_tag_tag-one_tag_tag-three-file
+++ b/t/t5515/fetch.main_.._.git_one_tag_tag-one_tag_tag-three-file
@@ -1,8 +1,8 @@
-# master ../.git one tag tag-one tag tag-three-file
+# main ../.git one tag tag-one tag tag-three-file
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 tag 'tag-one' of ../
0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
525b7fb068d59950d185a8779dc957c77eed73ba not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_.._.git_one_two b/t/t5515/fetch.main_.._.git_one_two
index 35ec578..048ad97 100644
--- a/t/t5515/fetch.master_.._.git_one_two
+++ b/t/t5515/fetch.main_.._.git_one_two
@@ -1,3 +1,3 @@
-# master ../.git one two
+# main ../.git one two
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
diff --git a/t/t5515/fetch.master_.._.git_tag_tag-one-tree_tag_tag-three-file b/t/t5515/fetch.main_.._.git_tag_tag-one-tree_tag_tag-three-file
index 0fd737c..df5f2a7 100644
--- a/t/t5515/fetch.master_.._.git_tag_tag-one-tree_tag_tag-three-file
+++ b/t/t5515/fetch.main_.._.git_tag_tag-one-tree_tag_tag-three-file
@@ -1,7 +1,7 @@
-# master ../.git tag tag-one-tree tag tag-three-file
+# main ../.git tag tag-one-tree tag tag-three-file
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
525b7fb068d59950d185a8779dc957c77eed73ba not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_.._.git_tag_tag-one_tag_tag-three b/t/t5515/fetch.main_.._.git_tag_tag-one_tag_tag-three
index e488986..a40b728 100644
--- a/t/t5515/fetch.master_.._.git_tag_tag-one_tag_tag-three
+++ b/t/t5515/fetch.main_.._.git_tag_tag-one_tag_tag-three
@@ -1,7 +1,7 @@
-# master ../.git tag tag-one tag tag-three
+# main ../.git tag tag-one tag tag-three
8e32a6d901327a23ef831511badce7bf3bf46689 tag 'tag-one' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 tag 'tag-three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
525b7fb068d59950d185a8779dc957c77eed73ba not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_branches-default b/t/t5515/fetch.main_branches-default
index 2eedd3b..e3466e8 100644
--- a/t/t5515/fetch.master_branches-default
+++ b/t/t5515/fetch.main_branches-default
@@ -1,6 +1,6 @@
-# master branches-default
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+# main branches-default
+b4ab76b1a01ea602209932134a44f1e6bd610832 branch 'main' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.master_branches-one b/t/t5515/fetch.main_branches-one
index 901ce21..a94f11a 100644
--- a/t/t5515/fetch.master_branches-one
+++ b/t/t5515/fetch.main_branches-one
@@ -1,6 +1,6 @@
-# master branches-one
+# main branches-one
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.master_config-explicit b/t/t5515/fetch.main_config-explicit
index 251c826..16d04c1 100644
--- a/t/t5515/fetch.master_config-explicit
+++ b/t/t5515/fetch.main_config-explicit
@@ -1,9 +1,9 @@
-# master config-explicit
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../
+# main config-explicit
+b4ab76b1a01ea602209932134a44f1e6bd610832 branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.master_config-glob b/t/t5515/fetch.main_config-glob
index 27c158e..f6a6f56 100644
--- a/t/t5515/fetch.master_config-glob
+++ b/t/t5515/fetch.main_config-glob
@@ -1,9 +1,9 @@
-# master config-glob
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
+# main config-glob
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.master_remote-explicit b/t/t5515/fetch.main_remote-explicit
index b3cfe6b..bf4fd65 100644
--- a/t/t5515/fetch.master_remote-explicit
+++ b/t/t5515/fetch.main_remote-explicit
@@ -1,9 +1,9 @@
-# master remote-explicit
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../
+# main remote-explicit
+b4ab76b1a01ea602209932134a44f1e6bd610832 branch 'main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
diff --git a/t/t5515/fetch.main_remote-glob b/t/t5515/fetch.main_remote-glob
new file mode 100644
index 0000000..91dc2e2
--- /dev/null
+++ b/t/t5515/fetch.main_remote-glob
@@ -0,0 +1,11 @@
+# main remote-glob
+b4ab76b1a01ea602209932134a44f1e6bd610832 not-for-merge branch 'main' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a not-for-merge tag 'tag-main' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
+c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
+525b7fb068d59950d185a8779dc957c77eed73ba not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_remote-glob b/t/t5515/fetch.master_remote-glob
deleted file mode 100644
index 118befd..0000000
--- a/t/t5515/fetch.master_remote-glob
+++ /dev/null
@@ -1,11 +0,0 @@
-# master remote-glob
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
-8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
-0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
-6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
-8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
-c61a82b60967180544e3c19f819ddbd0c9f89899 not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
-525b7fb068d59950d185a8779dc957c77eed73ba not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/refs.br-branches-default b/t/t5515/refs.br-branches-default
index 21917c1..dc4f2b7 100644
--- a/t/t5515/refs.br-branches-default
+++ b/t/t5515/refs.br-branches-default
@@ -1,10 +1,10 @@
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/heads/branches-default
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-branches-default-merge b/t/t5515/refs.br-branches-default-merge
index 21917c1..dc4f2b7 100644
--- a/t/t5515/refs.br-branches-default-merge
+++ b/t/t5515/refs.br-branches-default-merge
@@ -1,10 +1,10 @@
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/heads/branches-default
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-branches-default-merge_branches-default b/t/t5515/refs.br-branches-default-merge_branches-default
index 21917c1..dc4f2b7 100644
--- a/t/t5515/refs.br-branches-default-merge_branches-default
+++ b/t/t5515/refs.br-branches-default-merge_branches-default
@@ -1,10 +1,10 @@
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/heads/branches-default
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-branches-default-octopus b/t/t5515/refs.br-branches-default-octopus
index 21917c1..dc4f2b7 100644
--- a/t/t5515/refs.br-branches-default-octopus
+++ b/t/t5515/refs.br-branches-default-octopus
@@ -1,10 +1,10 @@
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/heads/branches-default
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-branches-default-octopus_branches-default b/t/t5515/refs.br-branches-default-octopus_branches-default
index 21917c1..dc4f2b7 100644
--- a/t/t5515/refs.br-branches-default-octopus_branches-default
+++ b/t/t5515/refs.br-branches-default-octopus_branches-default
@@ -1,10 +1,10 @@
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/heads/branches-default
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-branches-default_branches-default b/t/t5515/refs.br-branches-default_branches-default
index 21917c1..dc4f2b7 100644
--- a/t/t5515/refs.br-branches-default_branches-default
+++ b/t/t5515/refs.br-branches-default_branches-default
@@ -1,10 +1,10 @@
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/heads/branches-default
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-branches-one b/t/t5515/refs.br-branches-one
index 8a705a5..e8f79bf 100644
--- a/t/t5515/refs.br-branches-one
+++ b/t/t5515/refs.br-branches-one
@@ -1,10 +1,10 @@
8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-branches-one-merge b/t/t5515/refs.br-branches-one-merge
index 8a705a5..e8f79bf 100644
--- a/t/t5515/refs.br-branches-one-merge
+++ b/t/t5515/refs.br-branches-one-merge
@@ -1,10 +1,10 @@
8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-branches-one-merge_branches-one b/t/t5515/refs.br-branches-one-merge_branches-one
index 8a705a5..e8f79bf 100644
--- a/t/t5515/refs.br-branches-one-merge_branches-one
+++ b/t/t5515/refs.br-branches-one-merge_branches-one
@@ -1,10 +1,10 @@
8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-branches-one-octopus b/t/t5515/refs.br-branches-one-octopus
index 8a705a5..e8f79bf 100644
--- a/t/t5515/refs.br-branches-one-octopus
+++ b/t/t5515/refs.br-branches-one-octopus
@@ -1,10 +1,10 @@
8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-branches-one-octopus_branches-one b/t/t5515/refs.br-branches-one-octopus_branches-one
index 8a705a5..e8f79bf 100644
--- a/t/t5515/refs.br-branches-one-octopus_branches-one
+++ b/t/t5515/refs.br-branches-one-octopus_branches-one
@@ -1,10 +1,10 @@
8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-branches-one_branches-one b/t/t5515/refs.br-branches-one_branches-one
index 8a705a5..e8f79bf 100644
--- a/t/t5515/refs.br-branches-one_branches-one
+++ b/t/t5515/refs.br-branches-one_branches-one
@@ -1,10 +1,10 @@
8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-config-explicit b/t/t5515/refs.br-config-explicit
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-config-explicit
+++ b/t/t5515/refs.br-config-explicit
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-config-explicit-merge b/t/t5515/refs.br-config-explicit-merge
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-config-explicit-merge
+++ b/t/t5515/refs.br-config-explicit-merge
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-config-explicit-merge_config-explicit b/t/t5515/refs.br-config-explicit-merge_config-explicit
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-config-explicit-merge_config-explicit
+++ b/t/t5515/refs.br-config-explicit-merge_config-explicit
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-config-explicit-octopus b/t/t5515/refs.br-config-explicit-octopus
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-config-explicit-octopus
+++ b/t/t5515/refs.br-config-explicit-octopus
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-config-explicit-octopus_config-explicit b/t/t5515/refs.br-config-explicit-octopus_config-explicit
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-config-explicit-octopus_config-explicit
+++ b/t/t5515/refs.br-config-explicit-octopus_config-explicit
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-config-explicit_config-explicit b/t/t5515/refs.br-config-explicit_config-explicit
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-config-explicit_config-explicit
+++ b/t/t5515/refs.br-config-explicit_config-explicit
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-config-glob b/t/t5515/refs.br-config-glob
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-config-glob
+++ b/t/t5515/refs.br-config-glob
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-config-glob-merge b/t/t5515/refs.br-config-glob-merge
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-config-glob-merge
+++ b/t/t5515/refs.br-config-glob-merge
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-config-glob-merge_config-glob b/t/t5515/refs.br-config-glob-merge_config-glob
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-config-glob-merge_config-glob
+++ b/t/t5515/refs.br-config-glob-merge_config-glob
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-config-glob-octopus b/t/t5515/refs.br-config-glob-octopus
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-config-glob-octopus
+++ b/t/t5515/refs.br-config-glob-octopus
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-config-glob-octopus_config-glob b/t/t5515/refs.br-config-glob-octopus_config-glob
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-config-glob-octopus_config-glob
+++ b/t/t5515/refs.br-config-glob-octopus_config-glob
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-config-glob_config-glob b/t/t5515/refs.br-config-glob_config-glob
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-config-glob_config-glob
+++ b/t/t5515/refs.br-config-glob_config-glob
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-remote-explicit b/t/t5515/refs.br-remote-explicit
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-remote-explicit
+++ b/t/t5515/refs.br-remote-explicit
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-remote-explicit-merge b/t/t5515/refs.br-remote-explicit-merge
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-remote-explicit-merge
+++ b/t/t5515/refs.br-remote-explicit-merge
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-remote-explicit-merge_remote-explicit b/t/t5515/refs.br-remote-explicit-merge_remote-explicit
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-remote-explicit-merge_remote-explicit
+++ b/t/t5515/refs.br-remote-explicit-merge_remote-explicit
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-remote-explicit-octopus b/t/t5515/refs.br-remote-explicit-octopus
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-remote-explicit-octopus
+++ b/t/t5515/refs.br-remote-explicit-octopus
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-remote-explicit-octopus_remote-explicit b/t/t5515/refs.br-remote-explicit-octopus_remote-explicit
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-remote-explicit-octopus_remote-explicit
+++ b/t/t5515/refs.br-remote-explicit-octopus_remote-explicit
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-remote-explicit_remote-explicit b/t/t5515/refs.br-remote-explicit_remote-explicit
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-remote-explicit_remote-explicit
+++ b/t/t5515/refs.br-remote-explicit_remote-explicit
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-remote-glob b/t/t5515/refs.br-remote-glob
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-remote-glob
+++ b/t/t5515/refs.br-remote-glob
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-remote-glob-merge b/t/t5515/refs.br-remote-glob-merge
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-remote-glob-merge
+++ b/t/t5515/refs.br-remote-glob-merge
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-remote-glob-merge_remote-glob b/t/t5515/refs.br-remote-glob-merge_remote-glob
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-remote-glob-merge_remote-glob
+++ b/t/t5515/refs.br-remote-glob-merge_remote-glob
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-remote-glob-octopus b/t/t5515/refs.br-remote-glob-octopus
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-remote-glob-octopus
+++ b/t/t5515/refs.br-remote-glob-octopus
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-remote-glob-octopus_remote-glob b/t/t5515/refs.br-remote-glob-octopus_remote-glob
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-remote-glob-octopus_remote-glob
+++ b/t/t5515/refs.br-remote-glob-octopus_remote-glob
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-remote-glob_remote-glob b/t/t5515/refs.br-remote-glob_remote-glob
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-remote-glob_remote-glob
+++ b/t/t5515/refs.br-remote-glob_remote-glob
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-unconfig b/t/t5515/refs.br-unconfig
index 13e4ad2..f2ab01f 100644
--- a/t/t5515/refs.br-unconfig
+++ b/t/t5515/refs.br-unconfig
@@ -1,9 +1,9 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-unconfig_--tags_.._.git b/t/t5515/refs.br-unconfig_--tags_.._.git
index 13e4ad2..f2ab01f 100644
--- a/t/t5515/refs.br-unconfig_--tags_.._.git
+++ b/t/t5515/refs.br-unconfig_--tags_.._.git
@@ -1,9 +1,9 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-unconfig_.._.git b/t/t5515/refs.br-unconfig_.._.git
index 70962ea..4a74b68 100644
--- a/t/t5515/refs.br-unconfig_.._.git
+++ b/t/t5515/refs.br-unconfig_.._.git
@@ -1,5 +1,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
diff --git a/t/t5515/refs.br-unconfig_.._.git_one b/t/t5515/refs.br-unconfig_.._.git_one
index 70962ea..4a74b68 100644
--- a/t/t5515/refs.br-unconfig_.._.git_one
+++ b/t/t5515/refs.br-unconfig_.._.git_one
@@ -1,5 +1,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
diff --git a/t/t5515/refs.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file b/t/t5515/refs.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file
index 13e4ad2..f2ab01f 100644
--- a/t/t5515/refs.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file
+++ b/t/t5515/refs.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file
@@ -1,9 +1,9 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-unconfig_.._.git_one_two b/t/t5515/refs.br-unconfig_.._.git_one_two
index 70962ea..4a74b68 100644
--- a/t/t5515/refs.br-unconfig_.._.git_one_two
+++ b/t/t5515/refs.br-unconfig_.._.git_one_two
@@ -1,5 +1,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
diff --git a/t/t5515/refs.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file b/t/t5515/refs.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file
index 13e4ad2..f2ab01f 100644
--- a/t/t5515/refs.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file
+++ b/t/t5515/refs.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file
@@ -1,9 +1,9 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-unconfig_.._.git_tag_tag-one_tag_tag-three b/t/t5515/refs.br-unconfig_.._.git_tag_tag-one_tag_tag-three
index 13e4ad2..f2ab01f 100644
--- a/t/t5515/refs.br-unconfig_.._.git_tag_tag-one_tag_tag-three
+++ b/t/t5515/refs.br-unconfig_.._.git_tag_tag-one_tag_tag-three
@@ -1,9 +1,9 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-unconfig_branches-default b/t/t5515/refs.br-unconfig_branches-default
index 21917c1..dc4f2b7 100644
--- a/t/t5515/refs.br-unconfig_branches-default
+++ b/t/t5515/refs.br-unconfig_branches-default
@@ -1,10 +1,10 @@
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/heads/branches-default
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-unconfig_branches-one b/t/t5515/refs.br-unconfig_branches-one
index 8a705a5..e8f79bf 100644
--- a/t/t5515/refs.br-unconfig_branches-one
+++ b/t/t5515/refs.br-unconfig_branches-one
@@ -1,10 +1,10 @@
8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-unconfig_config-explicit b/t/t5515/refs.br-unconfig_config-explicit
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-unconfig_config-explicit
+++ b/t/t5515/refs.br-unconfig_config-explicit
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-unconfig_config-glob b/t/t5515/refs.br-unconfig_config-glob
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-unconfig_config-glob
+++ b/t/t5515/refs.br-unconfig_config-glob
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-unconfig_remote-explicit b/t/t5515/refs.br-unconfig_remote-explicit
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-unconfig_remote-explicit
+++ b/t/t5515/refs.br-unconfig_remote-explicit
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.br-unconfig_remote-glob b/t/t5515/refs.br-unconfig_remote-glob
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.br-unconfig_remote-glob
+++ b/t/t5515/refs.br-unconfig_remote-glob
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.master_.._.git_one_tag_tag-one_tag_tag-three-file b/t/t5515/refs.main
index 13e4ad2..f2ab01f 100644
--- a/t/t5515/refs.master_.._.git_one_tag_tag-one_tag_tag-three-file
+++ b/t/t5515/refs.main
@@ -1,9 +1,9 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.master_.._.git_tag_tag-one-tree_tag_tag-three-file b/t/t5515/refs.main_--tags_.._.git
index 13e4ad2..f2ab01f 100644
--- a/t/t5515/refs.master_.._.git_tag_tag-one-tree_tag_tag-three-file
+++ b/t/t5515/refs.main_--tags_.._.git
@@ -1,9 +1,9 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.master_.._.git_one_two b/t/t5515/refs.main_.._.git
index 70962ea..4a74b68 100644
--- a/t/t5515/refs.master_.._.git_one_two
+++ b/t/t5515/refs.main_.._.git
@@ -1,5 +1,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
diff --git a/t/t5515/refs.master_.._.git b/t/t5515/refs.main_.._.git_one
index 70962ea..4a74b68 100644
--- a/t/t5515/refs.master_.._.git
+++ b/t/t5515/refs.main_.._.git_one
@@ -1,5 +1,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
diff --git a/t/t5515/refs.master b/t/t5515/refs.main_.._.git_one_tag_tag-one_tag_tag-three-file
index 13e4ad2..f2ab01f 100644
--- a/t/t5515/refs.master
+++ b/t/t5515/refs.main_.._.git_one_tag_tag-one_tag_tag-three-file
@@ -1,9 +1,9 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.master_.._.git_one b/t/t5515/refs.main_.._.git_one_two
index 70962ea..4a74b68 100644
--- a/t/t5515/refs.master_.._.git_one
+++ b/t/t5515/refs.main_.._.git_one_two
@@ -1,5 +1,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
diff --git a/t/t5515/refs.master_--tags_.._.git b/t/t5515/refs.main_.._.git_tag_tag-one-tree_tag_tag-three-file
index 13e4ad2..f2ab01f 100644
--- a/t/t5515/refs.master_--tags_.._.git
+++ b/t/t5515/refs.main_.._.git_tag_tag-one-tree_tag_tag-three-file
@@ -1,9 +1,9 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.main_.._.git_tag_tag-one_tag_tag-three b/t/t5515/refs.main_.._.git_tag_tag-one_tag_tag-three
new file mode 100644
index 0000000..f2ab01f
--- /dev/null
+++ b/t/t5515/refs.main_.._.git_tag_tag-one_tag_tag-three
@@ -0,0 +1,11 @@
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
+8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
+8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
+22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
+c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
+0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file
+525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two
diff --git a/t/t5515/refs.master_branches-default b/t/t5515/refs.main_branches-default
index 21917c1..dc4f2b7 100644
--- a/t/t5515/refs.master_branches-default
+++ b/t/t5515/refs.main_branches-default
@@ -1,10 +1,10 @@
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/heads/branches-default
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.master_branches-one b/t/t5515/refs.main_branches-one
index 8a705a5..e8f79bf 100644
--- a/t/t5515/refs.master_branches-one
+++ b/t/t5515/refs.main_branches-one
@@ -1,10 +1,10 @@
8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.master_config-explicit b/t/t5515/refs.main_config-explicit
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.master_config-explicit
+++ b/t/t5515/refs.main_config-explicit
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.master_config-glob b/t/t5515/refs.main_config-glob
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.master_config-glob
+++ b/t/t5515/refs.main_config-glob
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.master_remote-explicit b/t/t5515/refs.main_remote-explicit
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.master_remote-explicit
+++ b/t/t5515/refs.main_remote-explicit
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.master_remote-glob b/t/t5515/refs.main_remote-glob
index 9bbbfd9..a28fa5f 100644
--- a/t/t5515/refs.master_remote-glob
+++ b/t/t5515/refs.main_remote-glob
@@ -1,13 +1,13 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.master_.._.git_tag_tag-one_tag_tag-three b/t/t5515/refs.master_.._.git_tag_tag-one_tag_tag-three
deleted file mode 100644
index 13e4ad2..0000000
--- a/t/t5515/refs.master_.._.git_tag_tag-one_tag_tag-three
+++ /dev/null
@@ -1,11 +0,0 @@
-0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
-8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
-0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
-6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
-8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
-22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
-c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
-0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file
-525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two
diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh
index 63205df..dd8e423 100755
--- a/t/t5526-fetch-submodules.sh
+++ b/t/t5526-fetch-submodules.sh
@@ -18,7 +18,7 @@ add_upstream_commit() {
head2=$(git rev-parse --short HEAD) &&
echo "Fetching submodule submodule" > ../expect.err &&
echo "From $pwd/submodule" >> ../expect.err &&
- echo " $head1..$head2 master -> origin/master" >> ../expect.err
+ echo " $head1..$head2 main -> origin/main" >> ../expect.err
) &&
(
cd deepsubmodule &&
@@ -30,7 +30,7 @@ add_upstream_commit() {
head2=$(git rev-parse --short HEAD) &&
echo "Fetching submodule submodule/subdir/deepsubmodule" >> ../expect.err
echo "From $pwd/deepsubmodule" >> ../expect.err &&
- echo " $head1..$head2 master -> origin/master" >> ../expect.err
+ echo " $head1..$head2 main -> origin/main" >> ../expect.err
)
}
@@ -61,7 +61,7 @@ test_expect_success setup '
)
'
-test_expect_success "fetch --recurse-submodules recurses into submodules" '
+test_expect_success PREPARE_FOR_MAIN_BRANCH "fetch --recurse-submodules recurses into submodules" '
add_upstream_commit &&
(
cd downstream &&
@@ -71,7 +71,7 @@ test_expect_success "fetch --recurse-submodules recurses into submodules" '
test_i18ncmp expect.err actual.err
'
-test_expect_success "submodule.recurse option triggers recursive fetch" '
+test_expect_success PREPARE_FOR_MAIN_BRANCH "submodule.recurse option triggers recursive fetch" '
add_upstream_commit &&
(
cd downstream &&
@@ -81,7 +81,7 @@ test_expect_success "submodule.recurse option triggers recursive fetch" '
test_i18ncmp expect.err actual.err
'
-test_expect_success "fetch --recurse-submodules -j2 has the same output behaviour" '
+test_expect_success PREPARE_FOR_MAIN_BRANCH "fetch --recurse-submodules -j2 has the same output behaviour" '
add_upstream_commit &&
(
cd downstream &&
@@ -111,7 +111,7 @@ test_expect_success "fetch --no-recurse-submodules only fetches superproject" '
test_must_be_empty actual.err
'
-test_expect_success "using fetchRecurseSubmodules=true in .gitmodules recurses into submodules" '
+test_expect_success PREPARE_FOR_MAIN_BRANCH "using fetchRecurseSubmodules=true in .gitmodules recurses into submodules" '
(
cd downstream &&
git config -f .gitmodules submodule.submodule.fetchRecurseSubmodules true &&
@@ -141,7 +141,7 @@ test_expect_success "using fetchRecurseSubmodules=false in .git/config overrides
test_must_be_empty actual.err
'
-test_expect_success "--recurse-submodules overrides fetchRecurseSubmodules setting from .git/config" '
+test_expect_success PREPARE_FOR_MAIN_BRANCH "--recurse-submodules overrides fetchRecurseSubmodules setting from .git/config" '
(
cd downstream &&
git fetch --recurse-submodules >../actual.out 2>../actual.err &&
@@ -170,7 +170,7 @@ test_expect_success "--quiet propagates to parallel submodules" '
test_must_be_empty actual.err
'
-test_expect_success "--dry-run propagates to submodules" '
+test_expect_success PREPARE_FOR_MAIN_BRANCH "--dry-run propagates to submodules" '
add_upstream_commit &&
(
cd downstream &&
@@ -180,7 +180,7 @@ test_expect_success "--dry-run propagates to submodules" '
test_i18ncmp expect.err actual.err
'
-test_expect_success "Without --dry-run propagates to submodules" '
+test_expect_success PREPARE_FOR_MAIN_BRANCH "Without --dry-run propagates to submodules" '
(
cd downstream &&
git fetch --recurse-submodules >../actual.out 2>../actual.err
@@ -189,7 +189,7 @@ test_expect_success "Without --dry-run propagates to submodules" '
test_i18ncmp expect.err actual.err
'
-test_expect_success "recurseSubmodules=true propagates into submodules" '
+test_expect_success PREPARE_FOR_MAIN_BRANCH "recurseSubmodules=true propagates into submodules" '
add_upstream_commit &&
(
cd downstream &&
@@ -200,7 +200,7 @@ test_expect_success "recurseSubmodules=true propagates into submodules" '
test_i18ncmp expect.err actual.err
'
-test_expect_success "--recurse-submodules overrides config in submodule" '
+test_expect_success PREPARE_FOR_MAIN_BRANCH "--recurse-submodules overrides config in submodule" '
add_upstream_commit &&
(
cd downstream &&
@@ -225,7 +225,7 @@ test_expect_success "--no-recurse-submodules overrides config setting" '
test_must_be_empty actual.err
'
-test_expect_success "Recursion doesn't happen when no new commits are fetched in the superproject" '
+test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion doesn't happen when no new commits are fetched in the superproject" '
(
cd downstream &&
(
@@ -239,13 +239,13 @@ test_expect_success "Recursion doesn't happen when no new commits are fetched in
test_must_be_empty actual.err
'
-test_expect_success "Recursion stops when no new submodule commits are fetched" '
+test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion stops when no new submodule commits are fetched" '
head1=$(git rev-parse --short HEAD) &&
git add submodule &&
git commit -m "new submodule" &&
head2=$(git rev-parse --short HEAD) &&
echo "From $pwd/." > expect.err.sub &&
- echo " $head1..$head2 master -> origin/master" >>expect.err.sub &&
+ echo " $head1..$head2 main -> origin/main" >>expect.err.sub &&
head -3 expect.err >> expect.err.sub &&
(
cd downstream &&
@@ -255,7 +255,7 @@ test_expect_success "Recursion stops when no new submodule commits are fetched"
test_must_be_empty actual.out
'
-test_expect_success "Recursion doesn't happen when new superproject commits don't change any submodules" '
+test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion doesn't happen when new superproject commits don't change any submodules" '
add_upstream_commit &&
head1=$(git rev-parse --short HEAD) &&
echo a > file &&
@@ -263,7 +263,7 @@ test_expect_success "Recursion doesn't happen when new superproject commits don'
git commit -m "new file" &&
head2=$(git rev-parse --short HEAD) &&
echo "From $pwd/." > expect.err.file &&
- echo " $head1..$head2 master -> origin/master" >> expect.err.file &&
+ echo " $head1..$head2 main -> origin/main" >> expect.err.file &&
(
cd downstream &&
git fetch >../actual.out 2>../actual.err
@@ -272,7 +272,7 @@ test_expect_success "Recursion doesn't happen when new superproject commits don'
test_i18ncmp expect.err.file actual.err
'
-test_expect_success "Recursion picks up config in submodule" '
+test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion picks up config in submodule" '
(
cd downstream &&
git fetch --recurse-submodules &&
@@ -287,7 +287,7 @@ test_expect_success "Recursion picks up config in submodule" '
git commit -m "new submodule" &&
head2=$(git rev-parse --short HEAD) &&
echo "From $pwd/." > expect.err.sub &&
- echo " $head1..$head2 master -> origin/master" >> expect.err.sub &&
+ echo " $head1..$head2 main -> origin/main" >> expect.err.sub &&
cat expect.err >> expect.err.sub &&
(
cd downstream &&
@@ -301,7 +301,7 @@ test_expect_success "Recursion picks up config in submodule" '
test_must_be_empty actual.out
'
-test_expect_success "Recursion picks up all submodules when necessary" '
+test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion picks up all submodules when necessary" '
add_upstream_commit &&
(
cd submodule &&
@@ -316,14 +316,14 @@ test_expect_success "Recursion picks up all submodules when necessary" '
head2=$(git rev-parse --short HEAD) &&
echo "Fetching submodule submodule" > ../expect.err.sub &&
echo "From $pwd/submodule" >> ../expect.err.sub &&
- echo " $head1..$head2 master -> origin/master" >> ../expect.err.sub
+ echo " $head1..$head2 main -> origin/main" >> ../expect.err.sub
) &&
head1=$(git rev-parse --short HEAD) &&
git add submodule &&
git commit -m "new submodule" &&
head2=$(git rev-parse --short HEAD) &&
echo "From $pwd/." > expect.err.2 &&
- echo " $head1..$head2 master -> origin/master" >> expect.err.2 &&
+ echo " $head1..$head2 main -> origin/main" >> expect.err.2 &&
cat expect.err.sub >> expect.err.2 &&
tail -3 expect.err >> expect.err.2 &&
(
@@ -334,7 +334,7 @@ test_expect_success "Recursion picks up all submodules when necessary" '
test_must_be_empty actual.out
'
-test_expect_success "'--recurse-submodules=on-demand' doesn't recurse when no new commits are fetched in the superproject (and ignores config)" '
+test_expect_success PREPARE_FOR_MAIN_BRANCH "'--recurse-submodules=on-demand' doesn't recurse when no new commits are fetched in the superproject (and ignores config)" '
add_upstream_commit &&
(
cd submodule &&
@@ -349,7 +349,7 @@ test_expect_success "'--recurse-submodules=on-demand' doesn't recurse when no ne
head2=$(git rev-parse --short HEAD) &&
echo Fetching submodule submodule > ../expect.err.sub &&
echo "From $pwd/submodule" >> ../expect.err.sub &&
- echo " $head1..$head2 master -> origin/master" >> ../expect.err.sub
+ echo " $head1..$head2 main -> origin/main" >> ../expect.err.sub
) &&
(
cd downstream &&
@@ -361,14 +361,14 @@ test_expect_success "'--recurse-submodules=on-demand' doesn't recurse when no ne
test_must_be_empty actual.err
'
-test_expect_success "'--recurse-submodules=on-demand' recurses as deep as necessary (and ignores config)" '
+test_expect_success PREPARE_FOR_MAIN_BRANCH "'--recurse-submodules=on-demand' recurses as deep as necessary (and ignores config)" '
head1=$(git rev-parse --short HEAD) &&
git add submodule &&
git commit -m "new submodule" &&
head2=$(git rev-parse --short HEAD) &&
tail -3 expect.err > expect.err.deepsub &&
echo "From $pwd/." > expect.err &&
- echo " $head1..$head2 master -> origin/master" >>expect.err &&
+ echo " $head1..$head2 main -> origin/main" >>expect.err &&
cat expect.err.sub >> expect.err &&
cat expect.err.deepsub >> expect.err &&
(
@@ -389,7 +389,7 @@ test_expect_success "'--recurse-submodules=on-demand' recurses as deep as necess
test_i18ncmp expect.err actual.err
'
-test_expect_success "'--recurse-submodules=on-demand' stops when no new submodule commits are found in the superproject (and ignores config)" '
+test_expect_success PREPARE_FOR_MAIN_BRANCH "'--recurse-submodules=on-demand' stops when no new submodule commits are found in the superproject (and ignores config)" '
add_upstream_commit &&
head1=$(git rev-parse --short HEAD) &&
echo a >> file &&
@@ -397,7 +397,7 @@ test_expect_success "'--recurse-submodules=on-demand' stops when no new submodul
git commit -m "new file" &&
head2=$(git rev-parse --short HEAD) &&
echo "From $pwd/." > expect.err.file &&
- echo " $head1..$head2 master -> origin/master" >> expect.err.file &&
+ echo " $head1..$head2 main -> origin/main" >> expect.err.file &&
(
cd downstream &&
git fetch --recurse-submodules=on-demand >../actual.out 2>../actual.err
@@ -406,7 +406,7 @@ test_expect_success "'--recurse-submodules=on-demand' stops when no new submodul
test_i18ncmp expect.err.file actual.err
'
-test_expect_success "'fetch.recurseSubmodules=on-demand' overrides global config" '
+test_expect_success PREPARE_FOR_MAIN_BRANCH "'fetch.recurseSubmodules=on-demand' overrides global config" '
(
cd downstream &&
git fetch --recurse-submodules
@@ -418,7 +418,7 @@ test_expect_success "'fetch.recurseSubmodules=on-demand' overrides global config
git commit -m "new submodule" &&
head2=$(git rev-parse --short HEAD) &&
echo "From $pwd/." > expect.err.2 &&
- echo " $head1..$head2 master -> origin/master" >>expect.err.2 &&
+ echo " $head1..$head2 main -> origin/main" >>expect.err.2 &&
head -3 expect.err >> expect.err.2 &&
(
cd downstream &&
@@ -434,7 +434,7 @@ test_expect_success "'fetch.recurseSubmodules=on-demand' overrides global config
test_i18ncmp expect.err.2 actual.err
'
-test_expect_success "'submodule.<sub>.fetchRecurseSubmodules=on-demand' overrides fetch.recurseSubmodules" '
+test_expect_success PREPARE_FOR_MAIN_BRANCH "'submodule.<sub>.fetchRecurseSubmodules=on-demand' overrides fetch.recurseSubmodules" '
(
cd downstream &&
git fetch --recurse-submodules
@@ -446,7 +446,7 @@ test_expect_success "'submodule.<sub>.fetchRecurseSubmodules=on-demand' override
git commit -m "new submodule" &&
head2=$(git rev-parse --short HEAD) &&
echo "From $pwd/." > expect.err.2 &&
- echo " $head1..$head2 master -> origin/master" >>expect.err.2 &&
+ echo " $head1..$head2 main -> origin/main" >>expect.err.2 &&
head -3 expect.err >> expect.err.2 &&
(
cd downstream &&
@@ -462,7 +462,7 @@ test_expect_success "'submodule.<sub>.fetchRecurseSubmodules=on-demand' override
test_i18ncmp expect.err.2 actual.err
'
-test_expect_success "don't fetch submodule when newly recorded commits are already present" '
+test_expect_success PREPARE_FOR_MAIN_BRANCH "don't fetch submodule when newly recorded commits are already present" '
(
cd submodule &&
git checkout -q HEAD^^
@@ -472,7 +472,7 @@ test_expect_success "don't fetch submodule when newly recorded commits are alrea
git commit -m "submodule rewound" &&
head2=$(git rev-parse --short HEAD) &&
echo "From $pwd/." > expect.err &&
- echo " $head1..$head2 master -> origin/master" >> expect.err &&
+ echo " $head1..$head2 main -> origin/main" >> expect.err &&
(
cd downstream &&
git fetch >../actual.out 2>../actual.err
@@ -485,7 +485,7 @@ test_expect_success "don't fetch submodule when newly recorded commits are alrea
)
'
-test_expect_success "'fetch.recurseSubmodules=on-demand' works also without .gitmodules entry" '
+test_expect_success PREPARE_FOR_MAIN_BRANCH "'fetch.recurseSubmodules=on-demand' works also without .gitmodules entry" '
(
cd downstream &&
git fetch --recurse-submodules
@@ -497,7 +497,7 @@ test_expect_success "'fetch.recurseSubmodules=on-demand' works also without .git
git commit -m "new submodule without .gitmodules" &&
head2=$(git rev-parse --short HEAD) &&
echo "From $pwd/." >expect.err.2 &&
- echo " $head1..$head2 master -> origin/master" >>expect.err.2 &&
+ echo " $head1..$head2 main -> origin/main" >>expect.err.2 &&
head -3 expect.err >>expect.err.2 &&
(
cd downstream &&
diff --git a/t/t5530-upload-pack-error.sh b/t/t5530-upload-pack-error.sh
index 205a263..9dd2d24 100755
--- a/t/t5530-upload-pack-error.sh
+++ b/t/t5530-upload-pack-error.sh
@@ -88,6 +88,23 @@ test_expect_success 'upload-pack fails due to error in pack-objects enumeration'
grep "pack-objects died" output.err
'
+test_expect_success 'upload-pack tolerates EOF just after stateless client wants' '
+ test_commit initial &&
+ head=$(git rev-parse HEAD) &&
+
+ {
+ packetize "want $head" &&
+ packetize "shallow $head" &&
+ packetize "deepen 1" &&
+ printf "0000"
+ } >request &&
+
+ printf "0000" >expect &&
+
+ git upload-pack --stateless-rpc . <request >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'create empty repository' '
mkdir foo &&
diff --git a/t/t5533-push-cas.sh b/t/t5533-push-cas.sh
index 0b0eb1d..7813e84 100755
--- a/t/t5533-push-cas.sh
+++ b/t/t5533-push-cas.sh
@@ -13,6 +13,46 @@ setup_srcdst_basic () {
)
}
+# For tests with "--force-if-includes".
+setup_src_dup_dst () {
+ rm -fr src dup dst &&
+ git init --bare dst &&
+ git clone --no-local dst src &&
+ git clone --no-local dst dup
+ (
+ cd src &&
+ test_commit A &&
+ test_commit B &&
+ test_commit C &&
+ git push origin
+ ) &&
+ (
+ cd dup &&
+ git fetch &&
+ git merge origin/master &&
+ git switch -c branch master~2 &&
+ test_commit D &&
+ test_commit E &&
+ git push origin --all
+ ) &&
+ (
+ cd src &&
+ git switch master &&
+ git fetch --all &&
+ git branch branch --track origin/branch &&
+ git rebase origin/master
+ ) &&
+ (
+ cd dup &&
+ git switch master &&
+ test_commit F &&
+ test_commit G &&
+ git switch branch &&
+ test_commit H &&
+ git push origin --all
+ )
+}
+
test_expect_success setup '
# create template repository
test_commit A &&
@@ -256,4 +296,101 @@ test_expect_success 'background updates of REMOTE can be mitigated with a non-up
)
'
+test_expect_success 'background updates to remote can be mitigated with "--force-if-includes"' '
+ setup_src_dup_dst &&
+ test_when_finished "rm -fr dst src dup" &&
+ git ls-remote dst refs/heads/master >expect.master &&
+ git ls-remote dst refs/heads/branch >expect.branch &&
+ (
+ cd src &&
+ git switch branch &&
+ test_commit I &&
+ git switch master &&
+ test_commit J &&
+ git fetch --all &&
+ test_must_fail git push --force-with-lease --force-if-includes --all
+ ) &&
+ git ls-remote dst refs/heads/master >actual.master &&
+ git ls-remote dst refs/heads/branch >actual.branch &&
+ test_cmp expect.master actual.master &&
+ test_cmp expect.branch actual.branch
+'
+
+test_expect_success 'background updates to remote can be mitigated with "push.useForceIfIncludes"' '
+ setup_src_dup_dst &&
+ test_when_finished "rm -fr dst src dup" &&
+ git ls-remote dst refs/heads/master >expect.master &&
+ (
+ cd src &&
+ git switch branch &&
+ test_commit I &&
+ git switch master &&
+ test_commit J &&
+ git fetch --all &&
+ git config --local push.useForceIfIncludes true &&
+ test_must_fail git push --force-with-lease=master origin master
+ ) &&
+ git ls-remote dst refs/heads/master >actual.master &&
+ test_cmp expect.master actual.master
+'
+
+test_expect_success '"--force-if-includes" should be disabled for --force-with-lease="<refname>:<expect>"' '
+ setup_src_dup_dst &&
+ test_when_finished "rm -fr dst src dup" &&
+ git ls-remote dst refs/heads/master >expect.master &&
+ (
+ cd src &&
+ git switch branch &&
+ test_commit I &&
+ git switch master &&
+ test_commit J &&
+ remote_head="$(git rev-parse refs/remotes/origin/master)" &&
+ git fetch --all &&
+ test_must_fail git push --force-if-includes --force-with-lease="master:$remote_head" 2>err &&
+ grep "stale info" err
+ ) &&
+ git ls-remote dst refs/heads/master >actual.master &&
+ test_cmp expect.master actual.master
+'
+
+test_expect_success '"--force-if-includes" should allow forced update after a rebase ("pull --rebase")' '
+ setup_src_dup_dst &&
+ test_when_finished "rm -fr dst src dup" &&
+ (
+ cd src &&
+ git switch branch &&
+ test_commit I &&
+ git switch master &&
+ test_commit J &&
+ git pull --rebase origin master &&
+ git push --force-if-includes --force-with-lease="master"
+ )
+'
+
+test_expect_success '"--force-if-includes" should allow forced update after a rebase ("pull --rebase", local rebase)' '
+ setup_src_dup_dst &&
+ test_when_finished "rm -fr dst src dup" &&
+ (
+ cd src &&
+ git switch branch &&
+ test_commit I &&
+ git switch master &&
+ test_commit J &&
+ git pull --rebase origin master &&
+ git rebase --onto HEAD~4 HEAD~1 &&
+ git push --force-if-includes --force-with-lease="master"
+ )
+'
+
+test_expect_success '"--force-if-includes" should allow deletes' '
+ setup_src_dup_dst &&
+ test_when_finished "rm -fr dst src dup" &&
+ (
+ cd src &&
+ git switch branch &&
+ git pull --rebase origin branch &&
+ git push --force-if-includes --force-with-lease="branch" origin :branch
+ )
+'
+
test_done
diff --git a/t/t5570-git-daemon.sh b/t/t5570-git-daemon.sh
index 34487bb..8f69a78 100755
--- a/t/t5570-git-daemon.sh
+++ b/t/t5570-git-daemon.sh
@@ -147,18 +147,18 @@ test_remote_error()
}
msg="access denied or repository not exported"
-test_expect_success 'clone non-existent' "test_remote_error '$msg' clone nowhere.git "
+test_expect_success 'clone non-existent' "test_remote_error '$msg' clone nowhere.git"
test_expect_success 'push disabled' "test_remote_error '$msg' push repo.git master"
-test_expect_success 'read access denied' "test_remote_error -x '$msg' fetch repo.git "
-test_expect_success 'not exported' "test_remote_error -n '$msg' fetch repo.git "
+test_expect_success 'read access denied' "test_remote_error -x '$msg' fetch repo.git"
+test_expect_success 'not exported' "test_remote_error -n '$msg' fetch repo.git"
stop_git_daemon
start_git_daemon --informative-errors
-test_expect_success 'clone non-existent' "test_remote_error 'no such repository' clone nowhere.git "
+test_expect_success 'clone non-existent' "test_remote_error 'no such repository' clone nowhere.git"
test_expect_success 'push disabled' "test_remote_error 'service not enabled' push repo.git master"
-test_expect_success 'read access denied' "test_remote_error -x 'no such repository' fetch repo.git "
-test_expect_success 'not exported' "test_remote_error -n 'repository not exported' fetch repo.git "
+test_expect_success 'read access denied' "test_remote_error -x 'no such repository' fetch repo.git"
+test_expect_success 'not exported' "test_remote_error -n 'repository not exported' fetch repo.git"
stop_git_daemon
start_git_daemon --interpolated-path="$GIT_DAEMON_DOCUMENT_ROOT_PATH/%H%D"
diff --git a/t/t5606-clone-options.sh b/t/t5606-clone-options.sh
index e69427f..7f082fb 100755
--- a/t/t5606-clone-options.sh
+++ b/t/t5606-clone-options.sh
@@ -15,7 +15,73 @@ test_expect_success 'setup' '
test_expect_success 'clone -o' '
git clone -o foo parent clone-o &&
- (cd clone-o && git rev-parse --verify refs/remotes/foo/master)
+ git -C clone-o rev-parse --verify refs/remotes/foo/master
+
+'
+
+test_expect_success 'rejects invalid -o/--origin' '
+
+ test_must_fail git clone -o "bad...name" parent clone-bad-name 2>err &&
+ test_i18ngrep "'\''bad...name'\'' is not a valid remote name" err
+
+'
+
+test_expect_success 'disallows --bare with --origin' '
+
+ test_must_fail git clone -o foo --bare parent clone-bare-o 2>err &&
+ test_debug "cat err" &&
+ test_i18ngrep -e "--bare and --origin foo options are incompatible" err
+
+'
+
+test_expect_success 'disallows --bare with --separate-git-dir' '
+
+ test_must_fail git clone --bare --separate-git-dir dot-git-destiation parent clone-bare-sgd 2>err &&
+ test_debug "cat err" &&
+ test_i18ngrep -e "--bare and --separate-git-dir are incompatible" err
+
+'
+
+test_expect_success 'uses "origin" for default remote name' '
+
+ git clone parent clone-default-origin &&
+ git -C clone-default-origin rev-parse --verify refs/remotes/origin/master
+
+'
+
+test_expect_success 'prefers --template config over normal config' '
+
+ template="$TRASH_DIRECTORY/template-with-config" &&
+ mkdir "$template" &&
+ git config --file "$template/config" foo.bar from_template &&
+ test_config_global foo.bar from_global &&
+ git clone "--template=$template" parent clone-template-config &&
+ test "$(git -C clone-template-config config --local foo.bar)" = "from_template"
+
+'
+
+test_expect_success 'prefers -c config over --template config' '
+
+ template="$TRASH_DIRECTORY/template-with-ignored-config" &&
+ mkdir "$template" &&
+ git config --file "$template/config" foo.bar from_template &&
+ git clone "--template=$template" -c foo.bar=inline parent clone-template-inline-config &&
+ test "$(git -C clone-template-inline-config config --local foo.bar)" = "inline"
+
+'
+
+test_expect_success 'prefers config "clone.defaultRemoteName" over default' '
+
+ test_config_global clone.defaultRemoteName from_config &&
+ git clone parent clone-config-origin &&
+ git -C clone-config-origin rev-parse --verify refs/remotes/from_config/master
+
+'
+
+test_expect_success 'prefers --origin over -c config' '
+
+ git clone -c clone.defaultRemoteName=inline --origin from_option parent clone-o-and-inline-config &&
+ git -C clone-o-and-inline-config rev-parse --verify refs/remotes/from_option/master
'
@@ -37,6 +103,7 @@ test_expect_success 'redirected clone -v does show progress' '
test_expect_success 'chooses correct default initial branch name' '
git init --bare empty &&
+ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \
git -c init.defaultBranch=up clone empty whats-up &&
test refs/heads/up = $(git -C whats-up symbolic-ref HEAD) &&
test refs/heads/up = $(git -C whats-up config branch.up.merge)
@@ -51,9 +118,11 @@ test_expect_success 'guesses initial branch name correctly' '
git -c init.defaultBranch=none init --bare no-head &&
git -C initial-branch push ../no-head guess abc &&
+ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \
git clone no-head is-it2 &&
test_must_fail git -C is-it2 symbolic-ref refs/remotes/origin/HEAD &&
git -C no-head update-ref --no-deref HEAD refs/heads/guess &&
+ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \
git -c init.defaultBranch=guess clone no-head is-it3 &&
test refs/remotes/origin/guess = \
$(git -C is-it3 symbolic-ref refs/remotes/origin/HEAD)
diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh
index d9ecf0f..b46940b 100755
--- a/t/t5703-upload-pack-ref-in-want.sh
+++ b/t/t5703-upload-pack-ref-in-want.sh
@@ -383,14 +383,14 @@ test_expect_success 'server is initially behind - ref in want' '
test_cmp expected actual
'
-test_expect_success 'server loses a ref - ref in want' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'server loses a ref - ref in want' '
git -C "$REPO" config uploadpack.allowRefInWant true &&
rm -rf local &&
cp -r "$LOCAL_PRISTINE" local &&
- echo "s/master/raster/" >"$HTTPD_ROOT_PATH/one-time-perl" &&
+ echo "s/main/rain/" >"$HTTPD_ROOT_PATH/one-time-perl" &&
test_must_fail git -C local fetch 2>err &&
- test_i18ngrep "fatal: remote error: unknown ref refs/heads/raster" err
+ test_i18ngrep "fatal: remote error: unknown ref refs/heads/rain" err
'
# DO NOT add non-httpd-specific tests here, because the last part of this
diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh
index bc95da8..99a1eaf 100755
--- a/t/t6006-rev-list-format.sh
+++ b/t/t6006-rev-list-format.sh
@@ -339,7 +339,7 @@ commit $head1
.. (hinzugef${added_utf8_part_iso88591}gt) foo
EOF
-test_expect_success 'prepare expected messages (for test %b)' '
+test_expect_success 'setup expected messages (for test %b)' '
cat <<-EOF >expected.utf-8 &&
commit $head3
This commit message is much longer than the others,
diff --git a/t/t6012-rev-list-simplify.sh b/t/t6012-rev-list-simplify.sh
index 7fc10f8..fd202fc 100755
--- a/t/t6012-rev-list-simplify.sh
+++ b/t/t6012-rev-list-simplify.sh
@@ -168,7 +168,7 @@ test_expect_success '--full-diff is not affected by --parents' '
#
# This example is explained in Documentation/rev-list-options.txt
-test_expect_success 'rebuild repo' '
+test_expect_success 'setup rebuild repo' '
rm -rf .git * &&
git init &&
git switch -c topic &&
diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh
index 7d54974..f3e66ea 100755
--- a/t/t6200-fmt-merge-msg.sh
+++ b/t/t6200-fmt-merge-msg.sh
@@ -556,7 +556,7 @@ test_expect_success 'merge.suppressDest configuration' '
head -n1 full.2 >actual &&
grep -e "Merge branch .side. into master$" actual &&
- git -c merge.suppressDest="ma??er" fmt-merge-msg <.git/FETCH_HEAD >full.3 &&
+ git -c merge.suppressDest="ma?*[rn]" fmt-merge-msg <.git/FETCH_HEAD >full.3 &&
head -n1 full.3 >actual &&
grep -e "Merge branch .side." actual &&
! grep -e " into master$" actual
diff --git a/t/t6302-for-each-ref-filter.sh b/t/t6302-for-each-ref-filter.sh
index 781e470..0a21669 100755
--- a/t/t6302-for-each-ref-filter.sh
+++ b/t/t6302-for-each-ref-filter.sh
@@ -113,9 +113,9 @@ test_expect_success '%(color) must fail' '
test_must_fail git for-each-ref --format="%(color)%(refname)"
'
-test_expect_success 'left alignment is default' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'left alignment is default' '
cat >expect <<-\EOF &&
- refname is refs/heads/master |refs/heads/master
+ refname is refs/heads/main |refs/heads/main
refname is refs/heads/side |refs/heads/side
refname is refs/odd/spot |refs/odd/spot
refname is refs/tags/annotated-tag|refs/tags/annotated-tag
@@ -131,9 +131,9 @@ test_expect_success 'left alignment is default' '
test_cmp expect actual
'
-test_expect_success 'middle alignment' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'middle alignment' '
cat >expect <<-\EOF &&
- | refname is refs/heads/master |refs/heads/master
+ | refname is refs/heads/main |refs/heads/main
| refname is refs/heads/side |refs/heads/side
| refname is refs/odd/spot |refs/odd/spot
|refname is refs/tags/annotated-tag|refs/tags/annotated-tag
@@ -149,9 +149,9 @@ test_expect_success 'middle alignment' '
test_cmp expect actual
'
-test_expect_success 'right alignment' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'right alignment' '
cat >expect <<-\EOF &&
- | refname is refs/heads/master|refs/heads/master
+ | refname is refs/heads/main|refs/heads/main
| refname is refs/heads/side|refs/heads/side
| refname is refs/odd/spot|refs/odd/spot
|refname is refs/tags/annotated-tag|refs/tags/annotated-tag
@@ -168,7 +168,7 @@ test_expect_success 'right alignment' '
'
cat >expect <<-\EOF
-| refname is refs/heads/master |refs/heads/master
+| refname is refs/heads/main |refs/heads/main
| refname is refs/heads/side |refs/heads/side
| refname is refs/odd/spot |refs/odd/spot
| refname is refs/tags/annotated-tag |refs/tags/annotated-tag
@@ -184,7 +184,7 @@ EOF
test_align_permutations() {
while read -r option
do
- test_expect_success "align:$option" '
+ test_expect_success PREPARE_FOR_MAIN_BRANCH "align:$option" '
git for-each-ref --format="|%(align:$option)refname is %(refname)%(end)|%(refname)" >actual &&
test_cmp expect actual
'
@@ -213,9 +213,9 @@ EOF
# Individual atoms inside %(align:...) and %(end) must not be quoted.
-test_expect_success 'alignment with format quote' "
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'alignment with format quote' "
cat >expect <<-\EOF &&
- |' '\''master| A U Thor'\'' '|
+ |' '\''main| A U Thor'\'' '|
|' '\''side| A U Thor'\'' '|
|' '\''odd/spot| A U Thor'\'' '|
|' '\''annotated-tag| '\'' '|
@@ -231,9 +231,9 @@ test_expect_success 'alignment with format quote' "
test_cmp expect actual
"
-test_expect_success 'nested alignment with quote formatting' "
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'nested alignment with quote formatting' "
cat >expect <<-\EOF &&
- |' master '|
+ |' main '|
|' side '|
|' odd/spot '|
|' annotated-tag '|
diff --git a/t/t6400-merge-df.sh b/t/t6400-merge-df.sh
index f1b8461..9da0838 100755
--- a/t/t6400-merge-df.sh
+++ b/t/t6400-merge-df.sh
@@ -81,7 +81,12 @@ test_expect_success 'modify/delete + directory/file conflict' '
test 5 -eq $(git ls-files -s | wc -l) &&
test 4 -eq $(git ls-files -u | wc -l) &&
- test 1 -eq $(git ls-files -o | wc -l) &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test 0 -eq $(git ls-files -o | wc -l)
+ else
+ test 1 -eq $(git ls-files -o | wc -l)
+ fi &&
test_path_is_file letters/file &&
test_path_is_file letters.txt &&
@@ -97,7 +102,12 @@ test_expect_success 'modify/delete + directory/file conflict; other way' '
test 5 -eq $(git ls-files -s | wc -l) &&
test 4 -eq $(git ls-files -u | wc -l) &&
- test 1 -eq $(git ls-files -o | wc -l) &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test 0 -eq $(git ls-files -o | wc -l)
+ else
+ test 1 -eq $(git ls-files -o | wc -l)
+ fi &&
test_path_is_file letters/file &&
test_path_is_file letters.txt &&
diff --git a/t/t6402-merge-rename.sh b/t/t6402-merge-rename.sh
index bbbba3d..3f64f62 100755
--- a/t/t6402-merge-rename.sh
+++ b/t/t6402-merge-rename.sh
@@ -320,7 +320,12 @@ test_expect_success 'Rename+D/F conflict; renamed file merges but dir in way' '
test_i18ngrep "CONFLICT (modify/delete): dir/file-in-the-way" output &&
test_i18ngrep "Auto-merging dir" output &&
- test_i18ngrep "Adding as dir~HEAD instead" output &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_i18ngrep "moving it to dir~HEAD instead" output
+ else
+ test_i18ngrep "Adding as dir~HEAD instead" output
+ fi &&
test 3 -eq "$(git ls-files -u | wc -l)" &&
test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&
@@ -342,7 +347,12 @@ test_expect_success 'Same as previous, but merged other way' '
! grep "error: refusing to lose untracked file at" errors &&
test_i18ngrep "CONFLICT (modify/delete): dir/file-in-the-way" output &&
test_i18ngrep "Auto-merging dir" output &&
- test_i18ngrep "Adding as dir~renamed-file-has-no-conflicts instead" output &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_i18ngrep "moving it to dir~renamed-file-has-no-conflicts instead" output
+ else
+ test_i18ngrep "Adding as dir~renamed-file-has-no-conflicts instead" output
+ fi &&
test 3 -eq "$(git ls-files -u | wc -l)" &&
test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&
@@ -397,7 +407,12 @@ test_expect_success 'Rename+D/F conflict; renamed file cannot merge and dir in t
test_must_fail git merge --strategy=recursive dir-in-way &&
test 5 -eq "$(git ls-files -u | wc -l)" &&
- test 3 -eq "$(git ls-files -u dir | grep -v file-in-the-way | wc -l)" &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test 3 -eq "$(git ls-files -u dir~HEAD | wc -l)"
+ else
+ test 3 -eq "$(git ls-files -u dir | grep -v file-in-the-way | wc -l)"
+ fi &&
test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&
test_must_fail git diff --quiet &&
@@ -415,7 +430,12 @@ test_expect_success 'Same as previous, but merged other way' '
test_must_fail git merge --strategy=recursive renamed-file-has-conflicts &&
test 5 -eq "$(git ls-files -u | wc -l)" &&
- test 3 -eq "$(git ls-files -u dir | grep -v file-in-the-way | wc -l)" &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test 3 -eq "$(git ls-files -u dir~renamed-file-has-conflicts | wc -l)"
+ else
+ test 3 -eq "$(git ls-files -u dir | grep -v file-in-the-way | wc -l)"
+ fi &&
test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&
test_must_fail git diff --quiet &&
@@ -471,7 +491,12 @@ test_expect_success 'both rename source and destination involved in D/F conflict
git checkout -q rename-dest^0 &&
test_must_fail git merge --strategy=recursive source-conflict &&
- test 1 -eq "$(git ls-files -u | wc -l)" &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test 2 -eq "$(git ls-files -u | wc -l)"
+ else
+ test 1 -eq "$(git ls-files -u | wc -l)"
+ fi &&
test_must_fail git diff --quiet &&
@@ -505,34 +530,63 @@ test_expect_success 'setup pair rename to parent of other (D/F conflicts)' '
git commit -m "Rename one/file -> two"
'
-test_expect_success 'pair rename to parent of other (D/F conflicts) w/ untracked dir' '
- git checkout -q rename-one^0 &&
- mkdir one &&
- test_must_fail git merge --strategy=recursive rename-two &&
+if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+then
+ test_expect_success 'pair rename to parent of other (D/F conflicts) w/ untracked dir' '
+ git checkout -q rename-one^0 &&
+ mkdir one &&
+ test_must_fail git merge --strategy=recursive rename-two &&
- test 2 -eq "$(git ls-files -u | wc -l)" &&
- test 1 -eq "$(git ls-files -u one | wc -l)" &&
- test 1 -eq "$(git ls-files -u two | wc -l)" &&
+ test 4 -eq "$(git ls-files -u | wc -l)" &&
+ test 2 -eq "$(git ls-files -u one | wc -l)" &&
+ test 2 -eq "$(git ls-files -u two | wc -l)" &&
- test_must_fail git diff --quiet &&
+ test_must_fail git diff --quiet &&
- test 4 -eq $(find . | grep -v .git | wc -l) &&
+ test 3 -eq $(find . | grep -v .git | wc -l) &&
- test_path_is_dir one &&
- test_path_is_file one~rename-two &&
- test_path_is_file two &&
- test "other" = $(cat one~rename-two) &&
- test "stuff" = $(cat two)
-'
+ test_path_is_file one &&
+ test_path_is_file two &&
+ test "other" = $(cat one) &&
+ test "stuff" = $(cat two)
+ '
+else
+ test_expect_success 'pair rename to parent of other (D/F conflicts) w/ untracked dir' '
+ git checkout -q rename-one^0 &&
+ mkdir one &&
+ test_must_fail git merge --strategy=recursive rename-two &&
+
+ test 2 -eq "$(git ls-files -u | wc -l)" &&
+ test 1 -eq "$(git ls-files -u one | wc -l)" &&
+ test 1 -eq "$(git ls-files -u two | wc -l)" &&
+
+ test_must_fail git diff --quiet &&
+
+ test 4 -eq $(find . | grep -v .git | wc -l) &&
+
+ test_path_is_dir one &&
+ test_path_is_file one~rename-two &&
+ test_path_is_file two &&
+ test "other" = $(cat one~rename-two) &&
+ test "stuff" = $(cat two)
+ '
+fi
test_expect_success 'pair rename to parent of other (D/F conflicts) w/ clean start' '
git reset --hard &&
git clean -fdqx &&
test_must_fail git merge --strategy=recursive rename-two &&
- test 2 -eq "$(git ls-files -u | wc -l)" &&
- test 1 -eq "$(git ls-files -u one | wc -l)" &&
- test 1 -eq "$(git ls-files -u two | wc -l)" &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test 4 -eq "$(git ls-files -u | wc -l)" &&
+ test 2 -eq "$(git ls-files -u one | wc -l)" &&
+ test 2 -eq "$(git ls-files -u two | wc -l)"
+ else
+ test 2 -eq "$(git ls-files -u | wc -l)" &&
+ test 1 -eq "$(git ls-files -u one | wc -l)" &&
+ test 1 -eq "$(git ls-files -u two | wc -l)"
+ fi &&
test_must_fail git diff --quiet &&
@@ -572,12 +626,22 @@ test_expect_success 'check handling of differently renamed file with D/F conflic
git checkout -q first-rename^0 &&
test_must_fail git merge --strategy=recursive second-rename &&
- test 5 -eq "$(git ls-files -s | wc -l)" &&
- test 3 -eq "$(git ls-files -u | wc -l)" &&
- test 1 -eq "$(git ls-files -u one | wc -l)" &&
- test 1 -eq "$(git ls-files -u two | wc -l)" &&
- test 1 -eq "$(git ls-files -u original | wc -l)" &&
- test 2 -eq "$(git ls-files -o | wc -l)" &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test 5 -eq "$(git ls-files -s | wc -l)" &&
+ test 3 -eq "$(git ls-files -u | wc -l)" &&
+ test 1 -eq "$(git ls-files -u one~HEAD | wc -l)" &&
+ test 1 -eq "$(git ls-files -u two~second-rename | wc -l)" &&
+ test 1 -eq "$(git ls-files -u original | wc -l)" &&
+ test 0 -eq "$(git ls-files -o | wc -l)"
+ else
+ test 5 -eq "$(git ls-files -s | wc -l)" &&
+ test 3 -eq "$(git ls-files -u | wc -l)" &&
+ test 1 -eq "$(git ls-files -u one | wc -l)" &&
+ test 1 -eq "$(git ls-files -u two | wc -l)" &&
+ test 1 -eq "$(git ls-files -u original | wc -l)" &&
+ test 2 -eq "$(git ls-files -o | wc -l)"
+ fi &&
test_path_is_file one/file &&
test_path_is_file two/file &&
diff --git a/t/t6404-recursive-merge.sh b/t/t6404-recursive-merge.sh
index 332cfc5..b1c3d4d 100755
--- a/t/t6404-recursive-merge.sh
+++ b/t/t6404-recursive-merge.sh
@@ -118,12 +118,22 @@ test_expect_success 'mark rename/delete as unmerged' '
test_tick &&
git commit -m rename &&
test_must_fail git merge delete &&
- test 1 = $(git ls-files --unmerged | wc -l) &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test 2 = $(git ls-files --unmerged | wc -l)
+ else
+ test 1 = $(git ls-files --unmerged | wc -l)
+ fi &&
git rev-parse --verify :2:a2 &&
test_must_fail git rev-parse --verify :3:a2 &&
git checkout -f delete &&
test_must_fail git merge rename &&
- test 1 = $(git ls-files --unmerged | wc -l) &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test 2 = $(git ls-files --unmerged | wc -l)
+ else
+ test 1 = $(git ls-files --unmerged | wc -l)
+ fi &&
test_must_fail git rev-parse --verify :2:a2 &&
git rev-parse --verify :3:a2
'
diff --git a/t/t6416-recursive-corner-cases.sh b/t/t6416-recursive-corner-cases.sh
index fd98989..887c219 100755
--- a/t/t6416-recursive-corner-cases.sh
+++ b/t/t6416-recursive-corner-cases.sh
@@ -3,6 +3,7 @@
test_description='recursive merge corner cases involving criss-cross merges'
. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-merge.sh
#
# L1 L2
@@ -537,9 +538,15 @@ test_expect_success 'setup differently handled merges of directory/file conflict
git checkout B^0 &&
test_must_fail git merge C^0 &&
- git clean -fd &&
- git rm -rf a/ &&
- git rm a &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ git rm -rf a/ &&
+ git rm a~HEAD
+ else
+ git clean -fd &&
+ git rm -rf a/ &&
+ git rm a
+ fi &&
git cat-file -p B:a >a2 &&
git add a2 &&
git commit -m D2 &&
@@ -558,7 +565,12 @@ test_expect_success 'setup differently handled merges of directory/file conflict
git checkout C^0 &&
test_must_fail git merge B^0 &&
- git clean -fd &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ git rm a~B^0
+ else
+ git clean -fd
+ fi &&
git rm -rf a/ &&
test_write_lines 1 2 3 4 5 6 7 8 >a &&
git add a &&
@@ -567,9 +579,15 @@ test_expect_success 'setup differently handled merges of directory/file conflict
git checkout C^0 &&
test_must_fail git merge B^0 &&
- git clean -fd &&
- git rm -rf a/ &&
- git rm a &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ git rm -rf a/ &&
+ git rm a~B^0
+ else
+ git clean -fd &&
+ git rm -rf a/ &&
+ git rm a
+ fi &&
test_write_lines 1 2 3 4 5 6 7 8 >a2 &&
git add a2 &&
git commit -m E4 &&
@@ -587,18 +605,34 @@ test_expect_success 'merge of D1 & E1 fails but has appropriate contents' '
test_must_fail git merge -s recursive E1^0 &&
- git ls-files -s >out &&
- test_line_count = 2 out &&
- git ls-files -u >out &&
- test_line_count = 1 out &&
- git ls-files -o >out &&
- test_line_count = 1 out &&
-
- git rev-parse >expect \
- A:ignore-me B:a &&
- git rev-parse >actual \
- :0:ignore-me :2:a &&
- test_cmp expect actual
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ git ls-files -s >out &&
+ test_line_count = 3 out &&
+ git ls-files -u >out &&
+ test_line_count = 2 out &&
+ git ls-files -o >out &&
+ test_line_count = 1 out &&
+
+ git rev-parse >expect \
+ A:ignore-me B:a D1:a &&
+ git rev-parse >actual \
+ :0:ignore-me :1:a :2:a &&
+ test_cmp expect actual
+ else
+ git ls-files -s >out &&
+ test_line_count = 2 out &&
+ git ls-files -u >out &&
+ test_line_count = 1 out &&
+ git ls-files -o >out &&
+ test_line_count = 1 out &&
+
+ git rev-parse >expect \
+ A:ignore-me B:a &&
+ git rev-parse >actual \
+ :0:ignore-me :2:a &&
+ test_cmp expect actual
+ fi
)
'
@@ -612,18 +646,34 @@ test_expect_success 'merge of E1 & D1 fails but has appropriate contents' '
test_must_fail git merge -s recursive D1^0 &&
- git ls-files -s >out &&
- test_line_count = 2 out &&
- git ls-files -u >out &&
- test_line_count = 1 out &&
- git ls-files -o >out &&
- test_line_count = 1 out &&
-
- git rev-parse >expect \
- A:ignore-me B:a &&
- git rev-parse >actual \
- :0:ignore-me :3:a &&
- test_cmp expect actual
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ git ls-files -s >out &&
+ test_line_count = 3 out &&
+ git ls-files -u >out &&
+ test_line_count = 2 out &&
+ git ls-files -o >out &&
+ test_line_count = 1 out &&
+
+ git rev-parse >expect \
+ A:ignore-me B:a D1:a &&
+ git rev-parse >actual \
+ :0:ignore-me :1:a :3:a &&
+ test_cmp expect actual
+ else
+ git ls-files -s >out &&
+ test_line_count = 2 out &&
+ git ls-files -u >out &&
+ test_line_count = 1 out &&
+ git ls-files -o >out &&
+ test_line_count = 1 out &&
+
+ git rev-parse >expect \
+ A:ignore-me B:a &&
+ git rev-parse >actual \
+ :0:ignore-me :3:a &&
+ test_cmp expect actual
+ fi
)
'
@@ -637,17 +687,32 @@ test_expect_success 'merge of D1 & E2 fails but has appropriate contents' '
test_must_fail git merge -s recursive E2^0 &&
- git ls-files -s >out &&
- test_line_count = 4 out &&
- git ls-files -u >out &&
- test_line_count = 3 out &&
- git ls-files -o >out &&
- test_line_count = 2 out &&
-
- git rev-parse >expect \
- B:a E2:a/file C:a/file A:ignore-me &&
- git rev-parse >actual \
- :2:a :3:a/file :1:a/file :0:ignore-me &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ git ls-files -s >out &&
+ test_line_count = 5 out &&
+ git ls-files -u >out &&
+ test_line_count = 4 out &&
+ git ls-files -o >out &&
+ test_line_count = 1 out &&
+
+ git rev-parse >expect \
+ B:a D1:a E2:a/file C:a/file A:ignore-me &&
+ git rev-parse >actual \
+ :1:a~HEAD :2:a~HEAD :3:a/file :1:a/file :0:ignore-me
+ else
+ git ls-files -s >out &&
+ test_line_count = 4 out &&
+ git ls-files -u >out &&
+ test_line_count = 3 out &&
+ git ls-files -o >out &&
+ test_line_count = 2 out &&
+
+ git rev-parse >expect \
+ B:a E2:a/file C:a/file A:ignore-me &&
+ git rev-parse >actual \
+ :2:a :3:a/file :1:a/file :0:ignore-me
+ fi &&
test_cmp expect actual &&
test_path_is_file a~HEAD
@@ -664,17 +729,32 @@ test_expect_success 'merge of E2 & D1 fails but has appropriate contents' '
test_must_fail git merge -s recursive D1^0 &&
- git ls-files -s >out &&
- test_line_count = 4 out &&
- git ls-files -u >out &&
- test_line_count = 3 out &&
- git ls-files -o >out &&
- test_line_count = 2 out &&
-
- git rev-parse >expect \
- B:a E2:a/file C:a/file A:ignore-me &&
- git rev-parse >actual \
- :3:a :2:a/file :1:a/file :0:ignore-me &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ git ls-files -s >out &&
+ test_line_count = 5 out &&
+ git ls-files -u >out &&
+ test_line_count = 4 out &&
+ git ls-files -o >out &&
+ test_line_count = 1 out &&
+
+ git rev-parse >expect \
+ B:a D1:a E2:a/file C:a/file A:ignore-me &&
+ git rev-parse >actual \
+ :1:a~D1^0 :3:a~D1^0 :2:a/file :1:a/file :0:ignore-me
+ else
+ git ls-files -s >out &&
+ test_line_count = 4 out &&
+ git ls-files -u >out &&
+ test_line_count = 3 out &&
+ git ls-files -o >out &&
+ test_line_count = 2 out &&
+
+ git rev-parse >expect \
+ B:a E2:a/file C:a/file A:ignore-me &&
+ git rev-parse >actual \
+ :3:a :2:a/file :1:a/file :0:ignore-me
+ fi &&
test_cmp expect actual &&
test_path_is_file a~D1^0
@@ -706,7 +786,7 @@ test_expect_success 'merge of D1 & E3 succeeds' '
)
'
-test_expect_success 'merge of D1 & E4 notifies user a and a2 are related' '
+test_expect_merge_algorithm failure success 'merge of D1 & E4 puts merge of a and a2 in both a and a2' '
test_when_finished "git -C directory-file reset --hard" &&
test_when_finished "git -C directory-file clean -fdqx" &&
(
@@ -724,7 +804,7 @@ test_expect_success 'merge of D1 & E4 notifies user a and a2 are related' '
test_line_count = 1 out &&
git rev-parse >expect \
- A:ignore-me B:a D1:a E4:a2 &&
+ A:ignore-me B:a E4:a2 E4:a2 &&
git rev-parse >actual \
:0:ignore-me :1:a~Temporary\ merge\ branch\ 2 :2:a :3:a2 &&
test_cmp expect actual
@@ -1069,7 +1149,7 @@ test_expect_success 'setup symlink modify/modify' '
)
'
-test_expect_failure 'check symlink modify/modify' '
+test_expect_merge_algorithm failure success 'check symlink modify/modify' '
(
cd symlink-modify-modify &&
@@ -1135,7 +1215,7 @@ test_expect_success 'setup symlink add/add' '
)
'
-test_expect_failure 'check symlink add/add' '
+test_expect_merge_algorithm failure success 'check symlink add/add' '
(
cd symlink-add-add &&
@@ -1223,7 +1303,7 @@ test_expect_success 'setup submodule modify/modify' '
)
'
-test_expect_failure 'check submodule modify/modify' '
+test_expect_merge_algorithm failure success 'check submodule modify/modify' '
(
cd submodule-modify-modify &&
@@ -1311,7 +1391,7 @@ test_expect_success 'setup submodule add/add' '
)
'
-test_expect_failure 'check submodule add/add' '
+test_expect_merge_algorithm failure success 'check submodule add/add' '
(
cd submodule-add-add &&
@@ -1386,7 +1466,7 @@ test_expect_success 'setup conflicting entry types (submodule vs symlink)' '
)
'
-test_expect_failure 'check conflicting entry types (submodule vs symlink)' '
+test_expect_merge_algorithm failure success 'check conflicting entry types (submodule vs symlink)' '
(
cd submodule-symlink-add-add &&
diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
index 3375eaf..78bfaf1 100755
--- a/t/t6422-merge-rename-corner-cases.sh
+++ b/t/t6422-merge-rename-corner-cases.sh
@@ -4,6 +4,7 @@ test_description="recursive merge corner cases w/ renames but not criss-crosses"
# t6036 has corner cases that involve both criss-cross merges and renames
. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-merge.sh
test_setup_rename_delete_untracked () {
test_create_repo rename-delete-untracked &&
@@ -312,15 +313,18 @@ test_expect_success 'rename/directory conflict + clean content merge' '
git ls-files -u >out &&
test_line_count = 1 out &&
git ls-files -o >out &&
- test_line_count = 2 out &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_line_count = 1 out
+ else
+ test_line_count = 2 out
+ fi &&
echo 0 >expect &&
git cat-file -p base:file >>expect &&
echo 7 >>expect &&
test_cmp expect newfile~HEAD &&
- test $(git rev-parse :2:newfile) = $(git hash-object expect) &&
-
test_path_is_file newfile/realfile &&
test_path_is_file newfile~HEAD
)
@@ -343,7 +347,12 @@ test_expect_success 'rename/directory conflict + content merge conflict' '
git ls-files -u >out &&
test_line_count = 3 out &&
git ls-files -o >out &&
- test_line_count = 2 out &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_line_count = 1 out
+ else
+ test_line_count = 2 out
+ fi &&
git cat-file -p left-conflict:newfile >left &&
git cat-file -p base:file >base &&
@@ -355,10 +364,16 @@ test_expect_success 'rename/directory conflict + content merge conflict' '
left base right &&
test_cmp left newfile~HEAD &&
- git rev-parse >expect \
- base:file left-conflict:newfile right:file &&
- git rev-parse >actual \
- :1:newfile :2:newfile :3:newfile &&
+ git rev-parse >expect \
+ base:file left-conflict:newfile right:file &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ git rev-parse >actual \
+ :1:newfile~HEAD :2:newfile~HEAD :3:newfile~HEAD
+ else
+ git rev-parse >actual \
+ :1:newfile :2:newfile :3:newfile
+ fi &&
test_cmp expect actual &&
test_path_is_file newfile/realfile &&
@@ -878,7 +893,7 @@ test_setup_rad () {
)
}
-test_expect_failure 'rad-check: rename/add/delete conflict' '
+test_expect_merge_algorithm failure success 'rad-check: rename/add/delete conflict' '
test_setup_rad &&
(
cd rad &&
@@ -951,7 +966,7 @@ test_setup_rrdd () {
)
}
-test_expect_failure 'rrdd-check: rename/rename(2to1)/delete/delete conflict' '
+test_expect_merge_algorithm failure success 'rrdd-check: rename/rename(2to1)/delete/delete conflict' '
test_setup_rrdd &&
(
cd rrdd &&
@@ -1040,7 +1055,7 @@ test_setup_mod6 () {
)
}
-test_expect_failure 'mod6-check: chains of rename/rename(1to2) and rename/rename(2to1)' '
+test_expect_merge_algorithm failure success 'mod6-check: chains of rename/rename(1to2) and rename/rename(2to1)' '
test_setup_mod6 &&
(
cd mod6 &&
diff --git a/t/t6423-merge-rename-directories.sh b/t/t6423-merge-rename-directories.sh
index f7ecbb8..4ab133f 100755
--- a/t/t6423-merge-rename-directories.sh
+++ b/t/t6423-merge-rename-directories.sh
@@ -26,6 +26,7 @@ test_description="recursive merge with directory renames"
# files that might be renamed into each other's paths.)
. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-merge.sh
###########################################################################
@@ -301,11 +302,20 @@ test_expect_success '1d: Directory renames cause a rename/rename(2to1) conflict'
git cat-file -p :2:x/wham >expect &&
git cat-file -p :3:x/wham >other &&
>empty &&
- test_must_fail git merge-file \
- -L "HEAD" \
- -L "" \
- -L "B^0" \
- expect empty other &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_must_fail git merge-file \
+ -L "HEAD:y/wham" \
+ -L "" \
+ -L "B^0:z/wham" \
+ expect empty other
+ else
+ test_must_fail git merge-file \
+ -L "HEAD" \
+ -L "" \
+ -L "B^0" \
+ expect empty other
+ fi &&
test_cmp expect x/wham
)
'
@@ -1176,10 +1186,18 @@ test_expect_success '5d: Directory/file/file conflict due to directory rename' '
git ls-files -u >out &&
test_line_count = 1 out &&
git ls-files -o >out &&
- test_line_count = 2 out &&
-
- git rev-parse >actual \
- :0:y/b :0:y/c :0:z/d :0:y/f :2:y/d :0:y/d/e &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_line_count = 1 out &&
+
+ git rev-parse >actual \
+ :0:y/b :0:y/c :0:z/d :0:y/f :2:y/d~HEAD :0:y/d/e
+ else
+ test_line_count = 2 out &&
+
+ git rev-parse >actual \
+ :0:y/b :0:y/c :0:z/d :0:y/f :2:y/d :0:y/d/e
+ fi &&
git rev-parse >expect \
O:z/b O:z/c B:z/d B:z/f A:y/d B:y/d/e &&
test_cmp expect actual &&
@@ -1262,35 +1280,144 @@ test_expect_success '6a: Tricky rename/delete' '
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
test_i18ngrep "CONFLICT (rename/delete).*z/c.*y/c" out &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ git ls-files -s >out &&
+ test_line_count = 3 out &&
+ git ls-files -u >out &&
+ test_line_count = 2 out &&
+ git ls-files -o >out &&
+ test_line_count = 1 out &&
+
+ git rev-parse >actual \
+ :0:y/b :1:y/c :3:y/c &&
+ git rev-parse >expect \
+ O:z/b O:z/c O:z/c
+ else
+ git ls-files -s >out &&
+ test_line_count = 2 out &&
+ git ls-files -u >out &&
+ test_line_count = 1 out &&
+ git ls-files -o >out &&
+ test_line_count = 1 out &&
+
+ git rev-parse >actual \
+ :0:y/b :3:y/c &&
+ git rev-parse >expect \
+ O:z/b O:z/c
+ fi &&
+ test_cmp expect actual
+ )
+'
+
+# Testcase 6b1, Same rename done on both sides
+# (Related to testcase 6b2 and 8e)
+# Commit O: z/{b,c,d,e}
+# Commit A: y/{b,c,d}, x/e
+# Commit B: y/{b,c,d}, z/{e,f}
+# Expected: y/{b,c,d,f}, x/e
+# Note: Directory rename detection says A renamed z/ -> y/ (3 paths renamed
+# to y/ and only 1 renamed to x/), therefore the new file 'z/f' in B
+# should be moved to 'y/f'.
+#
+# This is a bit of an edge case where any behavior might surprise users,
+# whether that is treating A as renaming z/ -> y/, treating A as renaming
+# z/ -> x/, or treating A as not doing any directory rename. However, I
+# think this answer is the least confusing and most consistent with the
+# rules elsewhere.
+#
+# A note about z/ -> x/, since it may not be clear how that could come
+# about: If we were to ignore files renamed by both sides
+# (i.e. z/{b,c,d}), as directory rename detection did in git-2.18 thru
+# at least git-2.28, then we would note there are no renames from z/ to
+# y/ and one rename from z/ to x/ and thus come to the conclusion that
+# A renamed z/ -> x/. This seems more confusing for end users than a
+# rename of z/ to y/, it makes directory rename detection behavior
+# harder for them to predict. As such, we modified the rule, changed
+# the behavior on testcases 6b2 and 8e, and introduced this 6b1 testcase.
+
+test_setup_6b1 () {
+ test_create_repo 6b1 &&
+ (
+ cd 6b1 &&
+
+ mkdir z &&
+ echo b >z/b &&
+ echo c >z/c &&
+ echo d >z/d &&
+ echo e >z/e &&
+ git add z &&
+ test_tick &&
+ git commit -m "O" &&
+
+ git branch O &&
+ git branch A &&
+ git branch B &&
+
+ git checkout A &&
+ git mv z y &&
+ mkdir x &&
+ git mv y/e x/e &&
+ test_tick &&
+ git commit -m "A" &&
+
+ git checkout B &&
+ git mv z y &&
+ mkdir z &&
+ git mv y/e z/e &&
+ echo f >z/f &&
+ git add z/f &&
+ test_tick &&
+ git commit -m "B"
+ )
+}
+
+test_expect_merge_algorithm failure success '6b1: Same renames done on both sides, plus another rename' '
+ test_setup_6b1 &&
+ (
+ cd 6b1 &&
+
+ git checkout A^0 &&
+
+ git -c merge.directoryRenames=true merge -s recursive B^0 &&
+
git ls-files -s >out &&
- test_line_count = 2 out &&
+ test_line_count = 5 out &&
git ls-files -u >out &&
- test_line_count = 1 out &&
+ test_line_count = 0 out &&
git ls-files -o >out &&
test_line_count = 1 out &&
git rev-parse >actual \
- :0:y/b :3:y/c &&
+ HEAD:y/b HEAD:y/c HEAD:y/d HEAD:x/e HEAD:y/f &&
git rev-parse >expect \
- O:z/b O:z/c &&
+ O:z/b O:z/c O:z/d O:z/e B:z/f &&
test_cmp expect actual
)
'
-# Testcase 6b, Same rename done on both sides
+# Testcase 6b2, Same rename done on both sides
# (Related to testcases 6c and 8e)
# Commit O: z/{b,c}
# Commit A: y/{b,c}
# Commit B: y/{b,c}, z/d
-# Expected: y/{b,c}, z/d
-# Note: If we did directory rename detection here, we'd move z/d into y/,
-# but B did that rename and still decided to put the file into z/,
-# so we probably shouldn't apply directory rename detection for it.
-
-test_setup_6b () {
- test_create_repo 6b &&
+# Expected: y/{b,c,d}
+# Alternate: y/{b,c}, z/d
+# Note: Directory rename detection says A renamed z/ -> y/, therefore the new
+# file 'z/d' in B should be moved to 'y/d'.
+#
+# We could potentially ignore the renames of z/{b,c} on side A since
+# those were renamed on both sides. However, it's a bit of a corner
+# case because what if there was also a z/e that side A moved to x/e
+# and side B left alone? If we used the "ignore renames done on both
+# sides" logic, then we'd compute that A renamed z/ -> x/, and move
+# z/d to x/d. That seems more surprising and uglier than allowing
+# the z/ -> y/ rename.
+
+test_setup_6b2 () {
+ test_create_repo 6b2 &&
(
- cd 6b &&
+ cd 6b2 &&
mkdir z &&
echo b >z/b &&
@@ -1318,10 +1445,10 @@ test_setup_6b () {
)
}
-test_expect_success '6b: Same rename done on both sides' '
- test_setup_6b &&
+test_expect_merge_algorithm failure success '6b2: Same rename done on both sides' '
+ test_setup_6b2 &&
(
- cd 6b &&
+ cd 6b2 &&
git checkout A^0 &&
@@ -1335,7 +1462,7 @@ test_expect_success '6b: Same rename done on both sides' '
test_line_count = 1 out &&
git rev-parse >actual \
- HEAD:y/b HEAD:y/c HEAD:z/d &&
+ HEAD:y/b HEAD:y/c HEAD:y/d &&
git rev-parse >expect \
O:z/b O:z/c B:z/d &&
test_cmp expect actual
@@ -1343,7 +1470,7 @@ test_expect_success '6b: Same rename done on both sides' '
'
# Testcase 6c, Rename only done on same side
-# (Related to testcases 6b and 8e)
+# (Related to testcases 6b1, 6b2, and 8e)
# Commit O: z/{b,c}
# Commit A: z/{b,c} (no change)
# Commit B: y/{b,c}, z/d
@@ -1705,11 +1832,20 @@ test_expect_success '7b: rename/rename(2to1), but only due to transitive rename'
git cat-file -p :2:y/d >expect &&
git cat-file -p :3:y/d >other &&
>empty &&
- test_must_fail git merge-file \
- -L "HEAD" \
- -L "" \
- -L "B^0" \
- expect empty other &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_must_fail git merge-file \
+ -L "HEAD:y/d" \
+ -L "" \
+ -L "B^0:z/d" \
+ expect empty other
+ else
+ test_must_fail git merge-file \
+ -L "HEAD" \
+ -L "" \
+ -L "B^0" \
+ expect empty other
+ fi &&
test_cmp expect y/d
)
'
@@ -1831,17 +1967,32 @@ test_expect_success '7d: transitive rename involved in rename/delete; how is it
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
test_i18ngrep "CONFLICT (rename/delete).*x/d.*y/d" out &&
- git ls-files -s >out &&
- test_line_count = 3 out &&
- git ls-files -u >out &&
- test_line_count = 1 out &&
- git ls-files -o >out &&
- test_line_count = 1 out &&
-
- git rev-parse >actual \
- :0:y/b :0:y/c :3:y/d &&
- git rev-parse >expect \
- O:z/b O:z/c O:x/d &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ git ls-files -s >out &&
+ test_line_count = 4 out &&
+ git ls-files -u >out &&
+ test_line_count = 2 out &&
+ git ls-files -o >out &&
+ test_line_count = 1 out &&
+
+ git rev-parse >actual \
+ :0:y/b :0:y/c :1:y/d :3:y/d &&
+ git rev-parse >expect \
+ O:z/b O:z/c O:x/d O:x/d
+ else
+ git ls-files -s >out &&
+ test_line_count = 3 out &&
+ git ls-files -u >out &&
+ test_line_count = 1 out &&
+ git ls-files -o >out &&
+ test_line_count = 1 out &&
+
+ git rev-parse >actual \
+ :0:y/b :0:y/c :3:y/d &&
+ git rev-parse >expect \
+ O:z/b O:z/c O:x/d
+ fi &&
test_cmp expect actual
)
'
@@ -1922,17 +2073,32 @@ test_expect_success '7e: transitive rename in rename/delete AND dirs in the way'
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
test_i18ngrep "CONFLICT (rename/delete).*x/d.*y/d" out &&
- git ls-files -s >out &&
- test_line_count = 5 out &&
- git ls-files -u >out &&
- test_line_count = 1 out &&
- git ls-files -o >out &&
- test_line_count = 2 out &&
-
- git rev-parse >actual \
- :0:x/d/f :0:y/d/g :0:y/b :0:y/c :3:y/d &&
- git rev-parse >expect \
- A:x/d/f A:y/d/g O:z/b O:z/c O:x/d &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ git ls-files -s >out &&
+ test_line_count = 6 out &&
+ git ls-files -u >out &&
+ test_line_count = 2 out &&
+ git ls-files -o >out &&
+ test_line_count = 1 out &&
+
+ git rev-parse >actual \
+ :0:x/d/f :0:y/d/g :0:y/b :0:y/c :1:y/d~B^0 :3:y/d~B^0 &&
+ git rev-parse >expect \
+ A:x/d/f A:y/d/g O:z/b O:z/c O:x/d O:x/d
+ else
+ git ls-files -s >out &&
+ test_line_count = 5 out &&
+ git ls-files -u >out &&
+ test_line_count = 1 out &&
+ git ls-files -o >out &&
+ test_line_count = 2 out &&
+
+ git rev-parse >actual \
+ :0:x/d/f :0:y/d/g :0:y/b :0:y/c :3:y/d &&
+ git rev-parse >expect \
+ A:x/d/f A:y/d/g O:z/b O:z/c O:x/d
+ fi &&
test_cmp expect actual &&
git hash-object y/d~B^0 >actual &&
@@ -2269,14 +2435,22 @@ test_expect_success '8d: rename/delete...or not?' '
# Notes: In commit A, directory z got renamed to y. In commit B, directory z
# did NOT get renamed; the directory is still present; instead it is
# considered to have just renamed a subset of paths in directory z
-# elsewhere. However, this is much like testcase 6b (where commit B
-# moves all the original paths out of z/ but opted to keep d
-# within z/). This makes it hard to judge where d should end up.
+# elsewhere. This is much like testcase 6b2 (where commit B moves all
+# the original paths out of z/ but opted to keep d within z/).
+#
+# It was not clear in the past what should be done with this testcase;
+# in fact, I noted that I "just picked one" previously. However,
+# following the new logic for testcase 6b2, we should take the rename
+# and move z/d to y/d.
#
-# It's possible that users would get confused about this, but what
-# should we do instead? It's not at all clear to me whether z/d or
-# y/d or something else is a better resolution here, and other cases
-# start getting really tricky, so I just picked one.
+# 6b1, 6b2, and this case are definitely somewhat fuzzy in terms of
+# whether they are optimal for end users, but (a) the default for
+# directory rename detection is to mark these all as conflicts
+# anyway, (b) it feels like this is less prone to higher order corner
+# case confusion, and (c) the current algorithm requires less global
+# knowledge (i.e. less coupling in the algorithm between renames done
+# on both sides) which thus means users are better able to predict
+# the behavior, and predict it without computing as many details.
test_setup_8e () {
test_create_repo 8e &&
@@ -3040,6 +3214,7 @@ test_expect_success '10a: Overwrite untracked with normal rename/delete' '
echo important >z/d &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
+ test_path_is_missing .git/MERGE_HEAD &&
test_i18ngrep "The following untracked working tree files would be overwritten by merge" err &&
git ls-files -s >out &&
@@ -3109,21 +3284,34 @@ test_expect_success '10b: Overwrite untracked with dir rename + delete' '
echo contents >y/e &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
- test_i18ngrep "CONFLICT (rename/delete).*Version B\^0 of y/d left in tree at y/d~B\^0" out &&
- test_i18ngrep "Error: Refusing to lose untracked file at y/e; writing to y/e~B\^0 instead" out &&
-
- git ls-files -s >out &&
- test_line_count = 3 out &&
- git ls-files -u >out &&
- test_line_count = 2 out &&
- git ls-files -o >out &&
- test_line_count = 5 out &&
-
- git rev-parse >actual \
- :0:y/b :3:y/d :3:y/e &&
- git rev-parse >expect \
- O:z/b O:z/c B:z/e &&
- test_cmp expect actual &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_path_is_missing .git/MERGE_HEAD &&
+ test_i18ngrep "error: The following untracked working tree files would be overwritten by merge" err &&
+
+ git ls-files -s >out &&
+ test_line_count = 1 out &&
+ git ls-files -u >out &&
+ test_line_count = 0 out &&
+ git ls-files -o >out &&
+ test_line_count = 5 out
+ else
+ test_i18ngrep "CONFLICT (rename/delete).*Version B\^0 of y/d left in tree at y/d~B\^0" out &&
+ test_i18ngrep "Error: Refusing to lose untracked file at y/e; writing to y/e~B\^0 instead" out &&
+
+ git ls-files -s >out &&
+ test_line_count = 3 out &&
+ git ls-files -u >out &&
+ test_line_count = 2 out &&
+ git ls-files -o >out &&
+ test_line_count = 5 out &&
+
+ git rev-parse >actual \
+ :0:y/b :3:y/d :3:y/e &&
+ git rev-parse >expect \
+ O:z/b O:z/c B:z/e &&
+ test_cmp expect actual
+ fi &&
echo very >expect &&
test_cmp expect y/c &&
@@ -3186,25 +3374,38 @@ test_expect_success '10c1: Overwrite untracked with dir rename/rename(1to2)' '
echo important >y/c &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
- test_i18ngrep "CONFLICT (rename/rename)" out &&
- test_i18ngrep "Refusing to lose untracked file at y/c; adding as y/c~B\^0 instead" out &&
-
- git ls-files -s >out &&
- test_line_count = 6 out &&
- git ls-files -u >out &&
- test_line_count = 3 out &&
- git ls-files -o >out &&
- test_line_count = 3 out &&
-
- git rev-parse >actual \
- :0:y/a :0:y/b :0:x/d :1:x/c :2:w/c :3:y/c &&
- git rev-parse >expect \
- O:z/a O:z/b O:x/d O:x/c O:x/c O:x/c &&
- test_cmp expect actual &&
-
- git hash-object y/c~B^0 >actual &&
- git rev-parse O:x/c >expect &&
- test_cmp expect actual &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_path_is_missing .git/MERGE_HEAD &&
+ test_i18ngrep "error: The following untracked working tree files would be overwritten by merge" err &&
+
+ git ls-files -s >out &&
+ test_line_count = 4 out &&
+ git ls-files -u >out &&
+ test_line_count = 0 out &&
+ git ls-files -o >out &&
+ test_line_count = 3 out
+ else
+ test_i18ngrep "CONFLICT (rename/rename)" out &&
+ test_i18ngrep "Refusing to lose untracked file at y/c; adding as y/c~B\^0 instead" out &&
+
+ git ls-files -s >out &&
+ test_line_count = 6 out &&
+ git ls-files -u >out &&
+ test_line_count = 3 out &&
+ git ls-files -o >out &&
+ test_line_count = 3 out &&
+
+ git rev-parse >actual \
+ :0:y/a :0:y/b :0:x/d :1:x/c :2:w/c :3:y/c &&
+ git rev-parse >expect \
+ O:z/a O:z/b O:x/d O:x/c O:x/c O:x/c &&
+ test_cmp expect actual &&
+
+ git hash-object y/c~B^0 >actual &&
+ git rev-parse O:x/c >expect &&
+ test_cmp expect actual
+ fi &&
echo important >expect &&
test_cmp expect y/c
@@ -3224,25 +3425,38 @@ test_expect_success '10c2: Overwrite untracked with dir rename/rename(1to2), oth
echo important >y/c &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive A^0 >out 2>err &&
- test_i18ngrep "CONFLICT (rename/rename)" out &&
- test_i18ngrep "Refusing to lose untracked file at y/c; adding as y/c~HEAD instead" out &&
-
- git ls-files -s >out &&
- test_line_count = 6 out &&
- git ls-files -u >out &&
- test_line_count = 3 out &&
- git ls-files -o >out &&
- test_line_count = 3 out &&
-
- git rev-parse >actual \
- :0:y/a :0:y/b :0:x/d :1:x/c :3:w/c :2:y/c &&
- git rev-parse >expect \
- O:z/a O:z/b O:x/d O:x/c O:x/c O:x/c &&
- test_cmp expect actual &&
-
- git hash-object y/c~HEAD >actual &&
- git rev-parse O:x/c >expect &&
- test_cmp expect actual &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_path_is_missing .git/MERGE_HEAD &&
+ test_i18ngrep "error: The following untracked working tree files would be overwritten by merge" err &&
+
+ git ls-files -s >out &&
+ test_line_count = 4 out &&
+ git ls-files -u >out &&
+ test_line_count = 0 out &&
+ git ls-files -o >out &&
+ test_line_count = 3 out
+ else
+ test_i18ngrep "CONFLICT (rename/rename)" out &&
+ test_i18ngrep "Refusing to lose untracked file at y/c; adding as y/c~HEAD instead" out &&
+
+ git ls-files -s >out &&
+ test_line_count = 6 out &&
+ git ls-files -u >out &&
+ test_line_count = 3 out &&
+ git ls-files -o >out &&
+ test_line_count = 3 out &&
+
+ git rev-parse >actual \
+ :0:y/a :0:y/b :0:x/d :1:x/c :3:w/c :2:y/c &&
+ git rev-parse >expect \
+ O:z/a O:z/b O:x/d O:x/c O:x/c O:x/c &&
+ test_cmp expect actual &&
+
+ git hash-object y/c~HEAD >actual &&
+ git rev-parse O:x/c >expect &&
+ test_cmp expect actual
+ fi &&
echo important >expect &&
test_cmp expect y/c
@@ -3300,37 +3514,50 @@ test_expect_success '10d: Delete untracked with dir rename/rename(2to1)' '
echo important >y/wham &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
- test_i18ngrep "CONFLICT (rename/rename)" out &&
- test_i18ngrep "Refusing to lose untracked file at y/wham" out &&
-
- git ls-files -s >out &&
- test_line_count = 6 out &&
- git ls-files -u >out &&
- test_line_count = 2 out &&
- git ls-files -o >out &&
- test_line_count = 3 out &&
-
- git rev-parse >actual \
- :0:y/a :0:y/b :0:y/d :0:y/e :2:y/wham :3:y/wham &&
- git rev-parse >expect \
- O:z/a O:z/b O:x/d O:x/e O:z/c O:x/f &&
- test_cmp expect actual &&
-
- test_must_fail git rev-parse :1:y/wham &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_path_is_missing .git/MERGE_HEAD &&
+ test_i18ngrep "error: The following untracked working tree files would be overwritten by merge" err &&
+
+ git ls-files -s >out &&
+ test_line_count = 6 out &&
+ git ls-files -u >out &&
+ test_line_count = 0 out &&
+ git ls-files -o >out &&
+ test_line_count = 3 out
+ else
+ test_i18ngrep "CONFLICT (rename/rename)" out &&
+ test_i18ngrep "Refusing to lose untracked file at y/wham" out &&
+
+ git ls-files -s >out &&
+ test_line_count = 6 out &&
+ git ls-files -u >out &&
+ test_line_count = 2 out &&
+ git ls-files -o >out &&
+ test_line_count = 3 out &&
+
+ git rev-parse >actual \
+ :0:y/a :0:y/b :0:y/d :0:y/e :2:y/wham :3:y/wham &&
+ git rev-parse >expect \
+ O:z/a O:z/b O:x/d O:x/e O:z/c O:x/f &&
+ test_cmp expect actual &&
+
+ test_must_fail git rev-parse :1:y/wham &&
+
+ # Test that two-way merge in y/wham~merged is as expected
+ git cat-file -p :2:y/wham >expect &&
+ git cat-file -p :3:y/wham >other &&
+ >empty &&
+ test_must_fail git merge-file \
+ -L "HEAD" \
+ -L "" \
+ -L "B^0" \
+ expect empty other &&
+ test_cmp expect y/wham~merged
+ fi &&
echo important >expect &&
- test_cmp expect y/wham &&
-
- # Test that the two-way merge in y/wham~merged is as expected
- git cat-file -p :2:y/wham >expect &&
- git cat-file -p :3:y/wham >other &&
- >empty &&
- test_must_fail git merge-file \
- -L "HEAD" \
- -L "" \
- -L "B^0" \
- expect empty other &&
- test_cmp expect y/wham~merged
+ test_cmp expect y/wham
)
'
@@ -3369,7 +3596,7 @@ test_setup_10e () {
)
}
-test_expect_failure '10e: Does git complain about untracked file that is not really in the way?' '
+test_expect_merge_algorithm failure success '10e: Does git complain about untracked file that is not really in the way?' '
test_setup_10e &&
(
cd 10e &&
@@ -3460,28 +3687,35 @@ test_expect_success '11a: Avoid losing dirty contents with simple rename' '
echo stuff >>z/c &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
- test_i18ngrep "Refusing to lose dirty file at z/c" out &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_path_is_missing .git/MERGE_HEAD &&
+ test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err
+ else
+ test_i18ngrep "Refusing to lose dirty file at z/c" out &&
+
+ git ls-files -s >out &&
+ test_line_count = 2 out &&
+ git ls-files -u >out &&
+ test_line_count = 1 out &&
+ git ls-files -o >out &&
+ test_line_count = 3 out &&
+
+ git rev-parse >actual \
+ :0:z/a :2:z/c &&
+ git rev-parse >expect \
+ O:z/a B:z/b &&
+ test_cmp expect actual &&
+
+ git hash-object z/c~HEAD >actual &&
+ git rev-parse B:z/b >expect &&
+ test_cmp expect actual
+ fi &&
test_seq 1 10 >expected &&
echo stuff >>expected &&
- test_cmp expected z/c &&
-
- git ls-files -s >out &&
- test_line_count = 2 out &&
- git ls-files -u >out &&
- test_line_count = 1 out &&
- git ls-files -o >out &&
- test_line_count = 4 out &&
+ test_cmp expected z/c
- git rev-parse >actual \
- :0:z/a :2:z/c &&
- git rev-parse >expect \
- O:z/a B:z/b &&
- test_cmp expect actual &&
-
- git hash-object z/c~HEAD >actual &&
- git rev-parse B:z/b >expect &&
- test_cmp expect actual
)
'
@@ -3532,32 +3766,39 @@ test_expect_success '11b: Avoid losing dirty file involved in directory rename'
git checkout A^0 &&
echo stuff >>z/c &&
- git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
- test_i18ngrep "Refusing to lose dirty file at z/c" out &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
+ test_path_is_missing .git/MERGE_HEAD &&
+ test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err
+ else
+ git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
+ test_i18ngrep "Refusing to lose dirty file at z/c" out &&
+
+ git ls-files -s >out &&
+ test_line_count = 3 out &&
+ git ls-files -u >out &&
+ test_line_count = 0 out &&
+ git ls-files -m >out &&
+ test_line_count = 0 out &&
+ git ls-files -o >out &&
+ test_line_count = 3 out &&
+
+ git rev-parse >actual \
+ :0:x/b :0:y/a :0:y/c &&
+ git rev-parse >expect \
+ O:x/b O:z/a B:x/c &&
+ test_cmp expect actual &&
+
+ git hash-object y/c >actual &&
+ git rev-parse B:x/c >expect &&
+ test_cmp expect actual
+ fi &&
grep -q stuff z/c &&
test_seq 1 10 >expected &&
echo stuff >>expected &&
- test_cmp expected z/c &&
-
- git ls-files -s >out &&
- test_line_count = 3 out &&
- git ls-files -u >out &&
- test_line_count = 0 out &&
- git ls-files -m >out &&
- test_line_count = 0 out &&
- git ls-files -o >out &&
- test_line_count = 4 out &&
-
- git rev-parse >actual \
- :0:x/b :0:y/a :0:y/c &&
- git rev-parse >expect \
- O:x/b O:z/a B:x/c &&
- test_cmp expect actual &&
-
- git hash-object y/c >actual &&
- git rev-parse B:x/c >expect &&
- test_cmp expect actual
+ test_cmp expected z/c
)
'
@@ -3609,7 +3850,13 @@ test_expect_success '11c: Avoid losing not-uptodate with rename + D/F conflict'
echo stuff >>y/c &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
- test_i18ngrep "following files would be overwritten by merge" err &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_path_is_missing .git/MERGE_HEAD &&
+ test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err
+ else
+ test_i18ngrep "following files would be overwritten by merge" err
+ fi &&
grep -q stuff y/c &&
test_seq 1 10 >expected &&
@@ -3677,29 +3924,35 @@ test_expect_success '11d: Avoid losing not-uptodate with rename + D/F conflict'
echo stuff >>z/c &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
- test_i18ngrep "Refusing to lose dirty file at z/c" out &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_path_is_missing .git/MERGE_HEAD &&
+ test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err
+ else
+ test_i18ngrep "Refusing to lose dirty file at z/c" out &&
+
+ git ls-files -s >out &&
+ test_line_count = 4 out &&
+ git ls-files -u >out &&
+ test_line_count = 1 out &&
+ git ls-files -o >out &&
+ test_line_count = 4 out &&
+
+ git rev-parse >actual \
+ :0:x/b :0:y/a :0:y/c/d :3:y/c &&
+ git rev-parse >expect \
+ O:x/b O:z/a B:y/c/d B:x/c &&
+ test_cmp expect actual &&
+
+ git hash-object y/c~HEAD >actual &&
+ git rev-parse B:x/c >expect &&
+ test_cmp expect actual
+ fi &&
grep -q stuff z/c &&
test_seq 1 10 >expected &&
echo stuff >>expected &&
- test_cmp expected z/c &&
-
- git ls-files -s >out &&
- test_line_count = 4 out &&
- git ls-files -u >out &&
- test_line_count = 1 out &&
- git ls-files -o >out &&
- test_line_count = 5 out &&
-
- git rev-parse >actual \
- :0:x/b :0:y/a :0:y/c/d :3:y/c &&
- git rev-parse >expect \
- O:x/b O:z/a B:y/c/d B:x/c &&
- test_cmp expect actual &&
-
- git hash-object y/c~HEAD >actual &&
- git rev-parse B:x/c >expect &&
- test_cmp expect actual
+ test_cmp expected z/c
)
'
@@ -3757,37 +4010,43 @@ test_expect_success '11e: Avoid deleting not-uptodate with dir rename/rename(1to
echo mods >>y/c &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
- test_i18ngrep "CONFLICT (rename/rename)" out &&
- test_i18ngrep "Refusing to lose dirty file at y/c" out &&
-
- git ls-files -s >out &&
- test_line_count = 7 out &&
- git ls-files -u >out &&
- test_line_count = 4 out &&
- git ls-files -o >out &&
- test_line_count = 3 out &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_path_is_missing .git/MERGE_HEAD &&
+ test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err
+ else
+ test_i18ngrep "CONFLICT (rename/rename)" out &&
+ test_i18ngrep "Refusing to lose dirty file at y/c" out &&
+
+ git ls-files -s >out &&
+ test_line_count = 7 out &&
+ git ls-files -u >out &&
+ test_line_count = 4 out &&
+ git ls-files -o >out &&
+ test_line_count = 3 out &&
+
+ git rev-parse >actual \
+ :0:y/a :0:y/b :0:x/d :1:x/c :2:w/c :2:y/c :3:y/c &&
+ git rev-parse >expect \
+ O:z/a O:z/b O:x/d O:x/c O:x/c A:y/c O:x/c &&
+ test_cmp expect actual &&
+
+ # See if y/c~merged has expected contents; requires manually
+ # doing the expected file merge
+ git cat-file -p A:y/c >c1 &&
+ git cat-file -p B:z/c >c2 &&
+ >empty &&
+ test_must_fail git merge-file \
+ -L "HEAD" \
+ -L "" \
+ -L "B^0" \
+ c1 empty c2 &&
+ test_cmp c1 y/c~merged
+ fi &&
echo different >expected &&
echo mods >>expected &&
- test_cmp expected y/c &&
-
- git rev-parse >actual \
- :0:y/a :0:y/b :0:x/d :1:x/c :2:w/c :2:y/c :3:y/c &&
- git rev-parse >expect \
- O:z/a O:z/b O:x/d O:x/c O:x/c A:y/c O:x/c &&
- test_cmp expect actual &&
-
- # See if y/c~merged has expected contents; requires manually
- # doing the expected file merge
- git cat-file -p A:y/c >c1 &&
- git cat-file -p B:z/c >c2 &&
- >empty &&
- test_must_fail git merge-file \
- -L "HEAD" \
- -L "" \
- -L "B^0" \
- c1 empty c2 &&
- test_cmp c1 y/c~merged
+ test_cmp expected y/c
)
'
@@ -3840,38 +4099,44 @@ test_expect_success '11f: Avoid deleting not-uptodate with dir rename/rename(2to
echo important >>y/wham &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
- test_i18ngrep "CONFLICT (rename/rename)" out &&
- test_i18ngrep "Refusing to lose dirty file at y/wham" out &&
-
- git ls-files -s >out &&
- test_line_count = 4 out &&
- git ls-files -u >out &&
- test_line_count = 2 out &&
- git ls-files -o >out &&
- test_line_count = 3 out &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_path_is_missing .git/MERGE_HEAD &&
+ test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err
+ else
+ test_i18ngrep "CONFLICT (rename/rename)" out &&
+ test_i18ngrep "Refusing to lose dirty file at y/wham" out &&
+
+ git ls-files -s >out &&
+ test_line_count = 4 out &&
+ git ls-files -u >out &&
+ test_line_count = 2 out &&
+ git ls-files -o >out &&
+ test_line_count = 3 out &&
+
+ test_must_fail git rev-parse :1:y/wham &&
+
+ git rev-parse >actual \
+ :0:y/a :0:y/b :2:y/wham :3:y/wham &&
+ git rev-parse >expect \
+ O:z/a O:z/b O:x/c O:x/d &&
+ test_cmp expect actual &&
+
+ # Test that two-way merge in y/wham~merged is as expected
+ git cat-file -p :2:y/wham >expect &&
+ git cat-file -p :3:y/wham >other &&
+ >empty &&
+ test_must_fail git merge-file \
+ -L "HEAD" \
+ -L "" \
+ -L "B^0" \
+ expect empty other &&
+ test_cmp expect y/wham~merged
+ fi &&
test_seq 1 10 >expected &&
echo important >>expected &&
- test_cmp expected y/wham &&
-
- test_must_fail git rev-parse :1:y/wham &&
-
- git rev-parse >actual \
- :0:y/a :0:y/b :2:y/wham :3:y/wham &&
- git rev-parse >expect \
- O:z/a O:z/b O:x/c O:x/d &&
- test_cmp expect actual &&
-
- # Test that the two-way merge in y/wham~merged is as expected
- git cat-file -p :2:y/wham >expect &&
- git cat-file -p :3:y/wham >other &&
- >empty &&
- test_must_fail git merge-file \
- -L "HEAD" \
- -L "" \
- -L "B^0" \
- expect empty other &&
- test_cmp expect y/wham~merged
+ test_cmp expected y/wham
)
'
@@ -3947,31 +4212,124 @@ test_expect_success '12a: Moving one directory hierarchy into another' '
)
'
-# Testcase 12b, Moving two directory hierarchies into each other
+# Testcase 12b1, Moving two directory hierarchies into each other
# (Related to testcases 1c and 12c)
# Commit O: node1/{leaf1, leaf2}, node2/{leaf3, leaf4}
# Commit A: node1/{leaf1, leaf2, node2/{leaf3, leaf4}}
# Commit B: node2/{leaf3, leaf4, node1/{leaf1, leaf2}}
-# Expected: node1/node2/node1/{leaf1, leaf2},
+# Expected: node1/node2/{leaf3, leaf4}
+# node2/node1/{leaf1, leaf2}
+# NOTE: If there were new files added to the old node1/ or node2/ directories,
+# then we would need to detect renames for those directories and would
+# find that:
+# commit A renames node2/ -> node1/node2/
+# commit B renames node1/ -> node2/node1/
+# Applying those directory renames to the initial result (making all
+# four paths experience a transitive renaming), yields
+# node1/node2/node1/{leaf1, leaf2}
# node2/node1/node2/{leaf3, leaf4}
+# as the result. It may be really weird to have two directories
+# rename each other, but simple rules give weird results when given
+# weird inputs. HOWEVER, the "If" at the beginning of those NOTE was
+# false; there were no new files added and thus there is no directory
+# rename detection to perform. As such, we just have simple renames
+# and the expected answer is:
+# node1/node2/{leaf3, leaf4}
+# node2/node1/{leaf1, leaf2}
+
+test_setup_12b1 () {
+ test_create_repo 12b1 &&
+ (
+ cd 12b1 &&
+
+ mkdir -p node1 node2 &&
+ echo leaf1 >node1/leaf1 &&
+ echo leaf2 >node1/leaf2 &&
+ echo leaf3 >node2/leaf3 &&
+ echo leaf4 >node2/leaf4 &&
+ git add node1 node2 &&
+ test_tick &&
+ git commit -m "O" &&
+
+ git branch O &&
+ git branch A &&
+ git branch B &&
+
+ git checkout A &&
+ git mv node2/ node1/ &&
+ test_tick &&
+ git commit -m "A" &&
+
+ git checkout B &&
+ git mv node1/ node2/ &&
+ test_tick &&
+ git commit -m "B"
+ )
+}
+
+test_expect_merge_algorithm failure success '12b1: Moving two directory hierarchies into each other' '
+ test_setup_12b1 &&
+ (
+ cd 12b1 &&
+
+ git checkout A^0 &&
+
+ git -c merge.directoryRenames=true merge -s recursive B^0 &&
+
+ git ls-files -s >out &&
+ test_line_count = 4 out &&
+
+ git rev-parse >actual \
+ HEAD:node2/node1/leaf1 \
+ HEAD:node2/node1/leaf2 \
+ HEAD:node1/node2/leaf3 \
+ HEAD:node1/node2/leaf4 &&
+ git rev-parse >expect \
+ O:node1/leaf1 \
+ O:node1/leaf2 \
+ O:node2/leaf3 \
+ O:node2/leaf4 &&
+ test_cmp expect actual
+ )
+'
+
+# Testcase 12b2, Moving two directory hierarchies into each other
+# (Related to testcases 1c and 12c)
+# Commit O: node1/{leaf1, leaf2}, node2/{leaf3, leaf4}
+# Commit A: node1/{leaf1, leaf2, leaf5, node2/{leaf3, leaf4}}
+# Commit B: node2/{leaf3, leaf4, leaf6, node1/{leaf1, leaf2}}
+# Expected: node1/node2/{node1/{leaf1, leaf2}, leaf6}
+# node2/node1/{node2/{leaf3, leaf4}, leaf5}
# NOTE: Without directory renames, we would expect
-# node2/node1/{leaf1, leaf2},
-# node1/node2/{leaf3, leaf4}
+# A: node2/leaf3 -> node1/node2/leaf3
+# A: node2/leaf1 -> node1/node2/leaf4
+# A: Adds node1/leaf5
+# B: node1/leaf1 -> node2/node1/leaf1
+# B: node1/leaf2 -> node2/node1/leaf2
+# B: Adds node2/leaf6
# with directory rename detection, we note that
# commit A renames node2/ -> node1/node2/
# commit B renames node1/ -> node2/node1/
-# therefore, applying those directory renames to the initial result
-# (making all four paths experience a transitive renaming), yields
-# the expected result.
+# therefore, applying A's directory rename to the paths added in B gives:
+# B: node1/leaf1 -> node1/node2/node1/leaf1
+# B: node1/leaf2 -> node1/node2/node1/leaf2
+# B: Adds node1/node2/leaf6
+# and applying B's directory rename to the paths added in A gives:
+# A: node2/leaf3 -> node2/node1/node2/leaf3
+# A: node2/leaf1 -> node2/node1/node2/leaf4
+# A: Adds node2/node1/leaf5
+# resulting in the expected
+# node1/node2/{node1/{leaf1, leaf2}, leaf6}
+# node2/node1/{node2/{leaf3, leaf4}, leaf5}
#
# You may ask, is it weird to have two directories rename each other?
# To which, I can do no more than shrug my shoulders and say that
# even simple rules give weird results when given weird inputs.
-test_setup_12b () {
- test_create_repo 12b &&
+test_setup_12b2 () {
+ test_create_repo 12b2 &&
(
- cd 12b &&
+ cd 12b2 &&
mkdir -p node1 node2 &&
echo leaf1 >node1/leaf1 &&
@@ -3988,43 +4346,51 @@ test_setup_12b () {
git checkout A &&
git mv node2/ node1/ &&
+ echo leaf5 >node1/leaf5 &&
+ git add node1/leaf5 &&
test_tick &&
git commit -m "A" &&
git checkout B &&
git mv node1/ node2/ &&
+ echo leaf6 >node2/leaf6 &&
+ git add node2/leaf6 &&
test_tick &&
git commit -m "B"
)
}
-test_expect_success '12b: Moving two directory hierarchies into each other' '
- test_setup_12b &&
+test_expect_success '12b2: Moving two directory hierarchies into each other' '
+ test_setup_12b2 &&
(
- cd 12b &&
+ cd 12b2 &&
git checkout A^0 &&
git -c merge.directoryRenames=true merge -s recursive B^0 &&
git ls-files -s >out &&
- test_line_count = 4 out &&
+ test_line_count = 6 out &&
git rev-parse >actual \
HEAD:node1/node2/node1/leaf1 \
HEAD:node1/node2/node1/leaf2 \
HEAD:node2/node1/node2/leaf3 \
- HEAD:node2/node1/node2/leaf4 &&
+ HEAD:node2/node1/node2/leaf4 \
+ HEAD:node2/node1/leaf5 \
+ HEAD:node1/node2/leaf6 &&
git rev-parse >expect \
O:node1/leaf1 \
O:node1/leaf2 \
O:node2/leaf3 \
- O:node2/leaf4 &&
+ O:node2/leaf4 \
+ A:node1/leaf5 \
+ B:node2/leaf6 &&
test_cmp expect actual
)
'
-# Testcase 12c, Moving two directory hierarchies into each other w/ content merge
+# Testcase 12c1, Moving two directory hierarchies into each other w/ content merge
# (Related to testcase 12b)
# Commit O: node1/{ leaf1_1, leaf2_1}, node2/{leaf3_1, leaf4_1}
# Commit A: node1/{ leaf1_2, leaf2_2, node2/{leaf3_2, leaf4_2}}
@@ -4032,13 +4398,103 @@ test_expect_success '12b: Moving two directory hierarchies into each other' '
# Expected: Content merge conflicts for each of:
# node1/node2/node1/{leaf1, leaf2},
# node2/node1/node2/{leaf3, leaf4}
-# NOTE: This is *exactly* like 12c, except that every path is modified on
+# NOTE: This is *exactly* like 12b1, except that every path is modified on
# each side of the merge.
-test_setup_12c () {
- test_create_repo 12c &&
+test_setup_12c1 () {
+ test_create_repo 12c1 &&
+ (
+ cd 12c1 &&
+
+ mkdir -p node1 node2 &&
+ printf "1\n2\n3\n4\n5\n6\n7\n8\nleaf1\n" >node1/leaf1 &&
+ printf "1\n2\n3\n4\n5\n6\n7\n8\nleaf2\n" >node1/leaf2 &&
+ printf "1\n2\n3\n4\n5\n6\n7\n8\nleaf3\n" >node2/leaf3 &&
+ printf "1\n2\n3\n4\n5\n6\n7\n8\nleaf4\n" >node2/leaf4 &&
+ git add node1 node2 &&
+ test_tick &&
+ git commit -m "O" &&
+
+ git branch O &&
+ git branch A &&
+ git branch B &&
+
+ git checkout A &&
+ git mv node2/ node1/ &&
+ for i in `git ls-files`; do echo side A >>$i; done &&
+ git add -u &&
+ test_tick &&
+ git commit -m "A" &&
+
+ git checkout B &&
+ git mv node1/ node2/ &&
+ for i in `git ls-files`; do echo side B >>$i; done &&
+ git add -u &&
+ test_tick &&
+ git commit -m "B"
+ )
+}
+
+test_expect_merge_algorithm failure success '12c1: Moving one directory hierarchy into another w/ content merge' '
+ test_setup_12c1 &&
+ (
+ cd 12c1 &&
+
+ git checkout A^0 &&
+
+ test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 &&
+
+ git ls-files -u >out &&
+ test_line_count = 12 out &&
+
+ git rev-parse >actual \
+ :1:node2/node1/leaf1 \
+ :1:node2/node1/leaf2 \
+ :1:node1/node2/leaf3 \
+ :1:node1/node2/leaf4 \
+ :2:node2/node1/leaf1 \
+ :2:node2/node1/leaf2 \
+ :2:node1/node2/leaf3 \
+ :2:node1/node2/leaf4 \
+ :3:node2/node1/leaf1 \
+ :3:node2/node1/leaf2 \
+ :3:node1/node2/leaf3 \
+ :3:node1/node2/leaf4 &&
+ git rev-parse >expect \
+ O:node1/leaf1 \
+ O:node1/leaf2 \
+ O:node2/leaf3 \
+ O:node2/leaf4 \
+ A:node1/leaf1 \
+ A:node1/leaf2 \
+ A:node1/node2/leaf3 \
+ A:node1/node2/leaf4 \
+ B:node2/node1/leaf1 \
+ B:node2/node1/leaf2 \
+ B:node2/leaf3 \
+ B:node2/leaf4 &&
+ test_cmp expect actual
+ )
+'
+
+# Testcase 12c2, Moving two directory hierarchies into each other w/ content merge
+# (Related to testcase 12b)
+# Commit O: node1/{ leaf1_1, leaf2_1}, node2/{leaf3_1, leaf4_1}
+# Commit A: node1/{ leaf1_2, leaf2_2, node2/{leaf3_2, leaf4_2}, leaf5}
+# Commit B: node2/{node1/{leaf1_3, leaf2_3}, leaf3_3, leaf4_3, leaf6}
+# Expected: Content merge conflicts for each of:
+# node1/node2/node1/{leaf1, leaf2}
+# node2/node1/node2/{leaf3, leaf4}
+# plus
+# node2/node1/leaf5
+# node1/node2/leaf6
+# NOTE: This is *exactly* like 12b2, except that every path from O is modified
+# on each side of the merge.
+
+test_setup_12c2 () {
+ test_create_repo 12c2 &&
(
- cd 12c &&
+ cd 12c2 &&
mkdir -p node1 node2 &&
printf "1\n2\n3\n4\n5\n6\n7\n8\nleaf1\n" >node1/leaf1 &&
@@ -4057,6 +4513,8 @@ test_setup_12c () {
git mv node2/ node1/ &&
for i in `git ls-files`; do echo side A >>$i; done &&
git add -u &&
+ echo leaf5 >node1/leaf5 &&
+ git add node1/leaf5 &&
test_tick &&
git commit -m "A" &&
@@ -4064,20 +4522,24 @@ test_setup_12c () {
git mv node1/ node2/ &&
for i in `git ls-files`; do echo side B >>$i; done &&
git add -u &&
+ echo leaf6 >node2/leaf6 &&
+ git add node2/leaf6 &&
test_tick &&
git commit -m "B"
)
}
-test_expect_success '12c: Moving one directory hierarchy into another w/ content merge' '
- test_setup_12c &&
+test_expect_success '12c2: Moving one directory hierarchy into another w/ content merge' '
+ test_setup_12c2 &&
(
- cd 12c &&
+ cd 12c2 &&
git checkout A^0 &&
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 &&
+ git ls-files -s >out &&
+ test_line_count = 14 out &&
git ls-files -u >out &&
test_line_count = 12 out &&
@@ -4093,7 +4555,9 @@ test_expect_success '12c: Moving one directory hierarchy into another w/ content
:3:node1/node2/node1/leaf1 \
:3:node1/node2/node1/leaf2 \
:3:node2/node1/node2/leaf3 \
- :3:node2/node1/node2/leaf4 &&
+ :3:node2/node1/node2/leaf4 \
+ :0:node2/node1/leaf5 \
+ :0:node1/node2/leaf6 &&
git rev-parse >expect \
O:node1/leaf1 \
O:node1/leaf2 \
@@ -4106,7 +4570,9 @@ test_expect_success '12c: Moving one directory hierarchy into another w/ content
B:node2/node1/leaf1 \
B:node2/node1/leaf2 \
B:node2/leaf3 \
- B:node2/leaf4 &&
+ B:node2/leaf4 \
+ A:node1/leaf5 \
+ B:node2/leaf6 &&
test_cmp expect actual
)
'
@@ -4227,6 +4693,208 @@ test_expect_success '12e: Rename/merge subdir into the root, variant 2' '
)
'
+# Testcase 12f, Rebase of patches with big directory rename
+# Commit O:
+# dir/subdir/{a,b,c,d,e_O,Makefile_TOP_O}
+# dir/subdir/tweaked/{f,g,h,Makefile_SUB_O}
+# dir/unchanged/<LOTS OF FILES>
+# Commit A:
+# (Remove f & g, move e into newsubdir, rename dir/->folder/, modify files)
+# folder/subdir/{a,b,c,d,Makefile_TOP_A}
+# folder/subdir/newsubdir/e_A
+# folder/subdir/tweaked/{h,Makefile_SUB_A}
+# folder/unchanged/<LOTS OF FILES>
+# Commit B1:
+# (add newfile.{c,py}, modify underscored files)
+# dir/{a,b,c,d,e_B1,Makefile_TOP_B1,newfile.c}
+# dir/tweaked/{f,g,h,Makefile_SUB_B1,newfile.py}
+# dir/unchanged/<LOTS OF FILES>
+# Commit B2:
+# (Modify e further, add newfile.rs)
+# dir/{a,b,c,d,e_B2,Makefile_TOP_B1,newfile.c,newfile.rs}
+# dir/tweaked/{f,g,h,Makefile_SUB_B1,newfile.py}
+# dir/unchanged/<LOTS OF FILES>
+# Expected:
+# B1-picked:
+# folder/subdir/{a,b,c,d,Makefile_TOP_Merge1,newfile.c}
+# folder/subdir/newsubdir/e_Merge1
+# folder/subdir/tweaked/{h,Makefile_SUB_Merge1,newfile.py}
+# folder/unchanged/<LOTS OF FILES>
+# B2-picked:
+# folder/subdir/{a,b,c,d,Makefile_TOP_Merge1,newfile.c,newfile.rs}
+# folder/subdir/newsubdir/e_Merge2
+# folder/subdir/tweaked/{h,Makefile_SUB_Merge1,newfile.py}
+# folder/unchanged/<LOTS OF FILES>
+# Things being checked here:
+# 1. dir/subdir/newfile.c does not get pushed into folder/subdir/newsubdir/.
+# dir/subdir/{a,b,c,d} -> folder/subdir/{a,b,c,d} looks like
+# dir/ -> folder/,
+# whereas dir/subdir/e -> folder/subdir/newsubdir/e looks like
+# dir/subdir/ -> folder/subdir/newsubdir/
+# and if we note that newfile.c is found in dir/subdir/, we might overlook
+# the dir/ -> folder/ rule that has more weight. Older git versions did
+# this.
+# 2. The code to do trivial directory resolves. Note that
+# dir/subdir/unchanged/ is unchanged and can be deleted, and files in the
+# new folder/subdir/unchanged/ are not needed as a target to any renames.
+# Thus, in the second collect_merge_info_callback() we can just resolve
+# these two directories trivially without recursing.)
+# 3. Exercising the codepaths for caching renames and deletes from one cherry
+# pick and re-applying them in the subsequent one.
+
+test_setup_12f () {
+ test_create_repo 12f &&
+ (
+ cd 12f &&
+
+ mkdir -p dir/unchanged &&
+ mkdir -p dir/subdir/tweaked &&
+ echo a >dir/subdir/a &&
+ echo b >dir/subdir/b &&
+ echo c >dir/subdir/c &&
+ echo d >dir/subdir/d &&
+ test_seq 1 10 >dir/subdir/e &&
+ test_seq 10 20 >dir/subdir/Makefile &&
+ echo f >dir/subdir/tweaked/f &&
+ echo g >dir/subdir/tweaked/g &&
+ echo h >dir/subdir/tweaked/h &&
+ test_seq 20 30 >dir/subdir/tweaked/Makefile &&
+ for i in `test_seq 1 88`; do
+ echo content $i >dir/unchanged/file_$i
+ done &&
+ git add . &&
+ git commit -m "O" &&
+
+ git branch O &&
+ git branch A &&
+ git branch B &&
+
+ git switch A &&
+ git rm dir/subdir/tweaked/f dir/subdir/tweaked/g &&
+ test_seq 2 10 >dir/subdir/e &&
+ test_seq 11 20 >dir/subdir/Makefile &&
+ test_seq 21 30 >dir/subdir/tweaked/Makefile &&
+ mkdir dir/subdir/newsubdir &&
+ git mv dir/subdir/e dir/subdir/newsubdir/ &&
+ git mv dir folder &&
+ git add . &&
+ git commit -m "A" &&
+
+ git switch B &&
+ mkdir dir/subdir/newsubdir/ &&
+ echo c code >dir/subdir/newfile.c &&
+ echo python code >dir/subdir/newsubdir/newfile.py &&
+ test_seq 1 11 >dir/subdir/e &&
+ test_seq 10 21 >dir/subdir/Makefile &&
+ test_seq 20 31 >dir/subdir/tweaked/Makefile &&
+ git add . &&
+ git commit -m "B1" &&
+
+ echo rust code >dir/subdir/newfile.rs &&
+ test_seq 1 12 >dir/subdir/e &&
+ git add . &&
+ git commit -m "B2"
+ )
+}
+
+test_expect_merge_algorithm failure success '12f: Trivial directory resolve, caching, all kinds of fun' '
+ test_setup_12f &&
+ (
+ cd 12f &&
+
+ git checkout A^0 &&
+ git branch Bmod B &&
+
+ GIT_TRACE2_PERF="$(pwd)/trace.output" git -c merge.directoryRenames=true rebase A Bmod &&
+
+ echo Checking the pick of B1... &&
+
+ test_must_fail git rev-parse Bmod~1:dir &&
+
+ git ls-tree -r Bmod~1 >out &&
+ test_line_count = 98 out &&
+
+ git diff --name-status A Bmod~1 >actual &&
+ q_to_tab >expect <<-\EOF &&
+ MQfolder/subdir/Makefile
+ AQfolder/subdir/newfile.c
+ MQfolder/subdir/newsubdir/e
+ AQfolder/subdir/newsubdir/newfile.py
+ MQfolder/subdir/tweaked/Makefile
+ EOF
+ test_cmp expect actual &&
+
+ # Three-way merged files
+ test_seq 2 11 >e_Merge1 &&
+ test_seq 11 21 >Makefile_TOP &&
+ test_seq 21 31 >Makefile_SUB &&
+ git hash-object >expect \
+ e_Merge1 \
+ Makefile_TOP \
+ Makefile_SUB &&
+ git rev-parse >actual \
+ Bmod~1:folder/subdir/newsubdir/e \
+ Bmod~1:folder/subdir/Makefile \
+ Bmod~1:folder/subdir/tweaked/Makefile &&
+ test_cmp expect actual &&
+
+ # New files showed up at the right location with right contents
+ git rev-parse >expect \
+ B~1:dir/subdir/newfile.c \
+ B~1:dir/subdir/newsubdir/newfile.py &&
+ git rev-parse >actual \
+ Bmod~1:folder/subdir/newfile.c \
+ Bmod~1:folder/subdir/newsubdir/newfile.py &&
+ test_cmp expect actual &&
+
+ # Removed files
+ test_path_is_missing folder/subdir/tweaked/f &&
+ test_path_is_missing folder/subdir/tweaked/g &&
+
+ # Unchanged files or directories
+ git rev-parse >actual \
+ Bmod~1:folder/subdir/a \
+ Bmod~1:folder/subdir/b \
+ Bmod~1:folder/subdir/c \
+ Bmod~1:folder/subdir/d \
+ Bmod~1:folder/unchanged \
+ Bmod~1:folder/subdir/tweaked/h &&
+ git rev-parse >expect \
+ O:dir/subdir/a \
+ O:dir/subdir/b \
+ O:dir/subdir/c \
+ O:dir/subdir/d \
+ O:dir/unchanged \
+ O:dir/subdir/tweaked/h &&
+ test_cmp expect actual &&
+
+ echo Checking the pick of B2... &&
+
+ test_must_fail git rev-parse Bmod:dir &&
+
+ git ls-tree -r Bmod >out &&
+ test_line_count = 99 out &&
+
+ git diff --name-status Bmod~1 Bmod >actual &&
+ q_to_tab >expect <<-\EOF &&
+ AQfolder/subdir/newfile.rs
+ MQfolder/subdir/newsubdir/e
+ EOF
+ test_cmp expect actual &&
+
+ # Three-way merged file
+ test_seq 2 12 >e_Merge2 &&
+ git hash-object e_Merge2 >expect &&
+ git rev-parse Bmod:folder/subdir/newsubdir/e >actual &&
+ test_cmp expect actual &&
+
+ grep region_enter.*collect_merge_info trace.output >collect &&
+ test_line_count = 4 collect &&
+ grep region_enter.*process_entries$ trace.output >process &&
+ test_line_count = 2 process
+ )
+'
+
###########################################################################
# SECTION 13: Checking informational and conflict messages
#
diff --git a/t/t6426-merge-skip-unneeded-updates.sh b/t/t6426-merge-skip-unneeded-updates.sh
index 6998136..d7eeee4 100755
--- a/t/t6426-merge-skip-unneeded-updates.sh
+++ b/t/t6426-merge-skip-unneeded-updates.sh
@@ -23,6 +23,7 @@ test_description="merge cases"
# files that might be renamed into each other's paths.)
. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-merge.sh
###########################################################################
@@ -666,7 +667,7 @@ test_setup_4a () {
# correct requires doing the merge in-memory first, then realizing that no
# updates to the file are necessary, and thus that we can just leave the path
# alone.
-test_expect_failure '4a: Change on A, change on B subset of A, dirty mods present' '
+test_expect_merge_algorithm failure success '4a: Change on A, change on B subset of A, dirty mods present' '
test_setup_4a &&
(
cd 4a &&
diff --git a/t/t6430-merge-recursive.sh b/t/t6430-merge-recursive.sh
index a328260..9c08e63 100755
--- a/t/t6430-merge-recursive.sh
+++ b/t/t6430-merge-recursive.sh
@@ -3,6 +3,7 @@
test_description='merge-recursive backend test'
. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-merge.sh
test_expect_success 'setup 1' '
@@ -641,7 +642,7 @@ test_expect_success 'merge-recursive copy vs. rename' '
test_cmp expected actual
'
-test_expect_failure 'merge-recursive rename vs. rename/symlink' '
+test_expect_merge_algorithm failure success 'merge-recursive rename vs. rename/symlink' '
git checkout -f rename &&
git merge rename-ln &&
diff --git a/t/t6436-merge-overwrite.sh b/t/t6436-merge-overwrite.sh
index dd8ab7e..dd93768 100755
--- a/t/t6436-merge-overwrite.sh
+++ b/t/t6436-merge-overwrite.sh
@@ -97,11 +97,19 @@ test_expect_success 'will not overwrite unstaged changes in renamed file' '
git mv c1.c other.c &&
git commit -m rename &&
cp important other.c &&
- test_must_fail git merge c1a >out &&
- test_i18ngrep "Refusing to lose dirty file at other.c" out &&
- test_path_is_file other.c~HEAD &&
- test $(git hash-object other.c~HEAD) = $(git rev-parse c1a:c1.c) &&
- test_cmp important other.c
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_must_fail git merge c1a >out 2>err &&
+ test_i18ngrep "would be overwritten by merge" err &&
+ test_cmp important other.c &&
+ test_path_is_missing .git/MERGE_HEAD
+ else
+ test_must_fail git merge c1a >out &&
+ test_i18ngrep "Refusing to lose dirty file at other.c" out &&
+ test_path_is_file other.c~HEAD &&
+ test $(git hash-object other.c~HEAD) = $(git rev-parse c1a:c1.c) &&
+ test_cmp important other.c
+ fi
'
test_expect_success 'will not overwrite untracked subtree' '
diff --git a/t/t6437-submodule-merge.sh b/t/t6437-submodule-merge.sh
index 6a1e5f8..3ead2b7 100755
--- a/t/t6437-submodule-merge.sh
+++ b/t/t6437-submodule-merge.sh
@@ -127,7 +127,12 @@ test_expect_success 'merging should conflict for non fast-forward' '
git checkout -b test-nonforward b &&
(cd sub &&
git rev-parse sub-d > ../expect) &&
- test_must_fail git merge c 2> actual &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_must_fail git merge c >actual
+ else
+ test_must_fail git merge c 2> actual
+ fi &&
grep $(cat expect) actual > /dev/null &&
git reset --hard)
'
@@ -138,9 +143,21 @@ test_expect_success 'merging should fail for ambiguous common parent' '
(cd sub &&
git checkout -b ambiguous sub-b &&
git merge sub-c &&
- git rev-parse sub-d > ../expect1 &&
- git rev-parse ambiguous > ../expect2) &&
- test_must_fail git merge c 2> actual &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ git rev-parse --short sub-d >../expect1 &&
+ git rev-parse --short ambiguous >../expect2
+ else
+ git rev-parse sub-d > ../expect1 &&
+ git rev-parse ambiguous > ../expect2
+ fi
+ ) &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_must_fail git merge c >actual
+ else
+ test_must_fail git merge c 2> actual
+ fi &&
grep $(cat expect1) actual > /dev/null &&
grep $(cat expect2) actual > /dev/null &&
git reset --hard)
diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh
index 00e09a3..fdb450e 100755
--- a/t/t7006-pager.sh
+++ b/t/t7006-pager.sh
@@ -19,7 +19,7 @@ test_expect_success 'setup' '
test_expect_success TTY 'some commands use a pager' '
rm -f paginated.out &&
test_terminal git log &&
- test -e paginated.out
+ test_path_is_file paginated.out
'
test_expect_failure TTY 'pager runs from subdir' '
@@ -65,49 +65,49 @@ test_expect_success !MINGW,TTY 'LESS and LV envvars set by git-sh-setup' '
test_expect_success TTY 'some commands do not use a pager' '
rm -f paginated.out &&
test_terminal git rev-list HEAD &&
- ! test -e paginated.out
+ test_path_is_missing paginated.out
'
test_expect_success 'no pager when stdout is a pipe' '
rm -f paginated.out &&
git log | cat &&
- ! test -e paginated.out
+ test_path_is_missing paginated.out
'
test_expect_success 'no pager when stdout is a regular file' '
rm -f paginated.out &&
git log >file &&
- ! test -e paginated.out
+ test_path_is_missing paginated.out
'
test_expect_success TTY 'git --paginate rev-list uses a pager' '
rm -f paginated.out &&
test_terminal git --paginate rev-list HEAD &&
- test -e paginated.out
+ test_path_is_file paginated.out
'
test_expect_success 'no pager even with --paginate when stdout is a pipe' '
rm -f file paginated.out &&
git --paginate log | cat &&
- ! test -e paginated.out
+ test_path_is_missing paginated.out
'
test_expect_success TTY 'no pager with --no-pager' '
rm -f paginated.out &&
test_terminal git --no-pager log &&
- ! test -e paginated.out
+ test_path_is_missing paginated.out
'
test_expect_success TTY 'configuration can disable pager' '
rm -f paginated.out &&
test_unconfig pager.grep &&
test_terminal git grep initial &&
- test -e paginated.out &&
+ test_path_is_file paginated.out &&
rm -f paginated.out &&
test_config pager.grep false &&
test_terminal git grep initial &&
- ! test -e paginated.out
+ test_path_is_missing paginated.out
'
test_expect_success TTY 'configuration can enable pager (from subdir)' '
@@ -122,107 +122,107 @@ test_expect_success TTY 'configuration can enable pager (from subdir)' '
test_terminal git bundle unbundle ../test.bundle
) &&
{
- test -e paginated.out ||
- test -e subdir/paginated.out
+ test_path_is_file paginated.out ||
+ test_path_is_file subdir/paginated.out
}
'
test_expect_success TTY 'git tag -l defaults to paging' '
rm -f paginated.out &&
test_terminal git tag -l &&
- test -e paginated.out
+ test_path_is_file paginated.out
'
test_expect_success TTY 'git tag -l respects pager.tag' '
rm -f paginated.out &&
test_terminal git -c pager.tag=false tag -l &&
- ! test -e paginated.out
+ test_path_is_missing paginated.out
'
test_expect_success TTY 'git tag -l respects --no-pager' '
rm -f paginated.out &&
test_terminal git -c pager.tag --no-pager tag -l &&
- ! test -e paginated.out
+ test_path_is_missing paginated.out
'
test_expect_success TTY 'git tag with no args defaults to paging' '
# no args implies -l so this should page like -l
rm -f paginated.out &&
test_terminal git tag &&
- test -e paginated.out
+ test_path_is_file paginated.out
'
test_expect_success TTY 'git tag with no args respects pager.tag' '
# no args implies -l so this should page like -l
rm -f paginated.out &&
test_terminal git -c pager.tag=false tag &&
- ! test -e paginated.out
+ test_path_is_missing paginated.out
'
test_expect_success TTY 'git tag --contains defaults to paging' '
# --contains implies -l so this should page like -l
rm -f paginated.out &&
test_terminal git tag --contains &&
- test -e paginated.out
+ test_path_is_file paginated.out
'
test_expect_success TTY 'git tag --contains respects pager.tag' '
# --contains implies -l so this should page like -l
rm -f paginated.out &&
test_terminal git -c pager.tag=false tag --contains &&
- ! test -e paginated.out
+ test_path_is_missing paginated.out
'
test_expect_success TTY 'git tag -a defaults to not paging' '
test_when_finished "git tag -d newtag" &&
rm -f paginated.out &&
test_terminal git tag -am message newtag &&
- ! test -e paginated.out
+ test_path_is_missing paginated.out
'
test_expect_success TTY 'git tag -a ignores pager.tag' '
test_when_finished "git tag -d newtag" &&
rm -f paginated.out &&
test_terminal git -c pager.tag tag -am message newtag &&
- ! test -e paginated.out
+ test_path_is_missing paginated.out
'
test_expect_success TTY 'git tag -a respects --paginate' '
test_when_finished "git tag -d newtag" &&
rm -f paginated.out &&
test_terminal git --paginate tag -am message newtag &&
- test -e paginated.out
+ test_path_is_file paginated.out
'
test_expect_success TTY 'git tag as alias ignores pager.tag with -a' '
test_when_finished "git tag -d newtag" &&
rm -f paginated.out &&
test_terminal git -c pager.tag -c alias.t=tag t -am message newtag &&
- ! test -e paginated.out
+ test_path_is_missing paginated.out
'
test_expect_success TTY 'git tag as alias respects pager.tag with -l' '
rm -f paginated.out &&
test_terminal git -c pager.tag=false -c alias.t=tag t -l &&
- ! test -e paginated.out
+ test_path_is_missing paginated.out
'
test_expect_success TTY 'git branch defaults to paging' '
rm -f paginated.out &&
test_terminal git branch &&
- test -e paginated.out
+ test_path_is_file paginated.out
'
test_expect_success TTY 'git branch respects pager.branch' '
rm -f paginated.out &&
test_terminal git -c pager.branch=false branch &&
- ! test -e paginated.out
+ test_path_is_missing paginated.out
'
test_expect_success TTY 'git branch respects --no-pager' '
rm -f paginated.out &&
test_terminal git --no-pager branch &&
- ! test -e paginated.out
+ test_path_is_missing paginated.out
'
test_expect_success TTY 'git branch --edit-description ignores pager.branch' '
@@ -232,8 +232,8 @@ test_expect_success TTY 'git branch --edit-description ignores pager.branch' '
touch editor.used
EOF
EDITOR=./editor test_terminal git -c pager.branch branch --edit-description &&
- ! test -e paginated.out &&
- test -e editor.used
+ test_path_is_missing paginated.out &&
+ test_path_is_file editor.used
'
test_expect_success TTY 'git branch --set-upstream-to ignores pager.branch' '
@@ -242,13 +242,13 @@ test_expect_success TTY 'git branch --set-upstream-to ignores pager.branch' '
test_when_finished "git branch -D other" &&
test_terminal git -c pager.branch branch --set-upstream-to=other &&
test_when_finished "git branch --unset-upstream" &&
- ! test -e paginated.out
+ test_path_is_missing paginated.out
'
test_expect_success TTY 'git config ignores pager.config when setting' '
rm -f paginated.out &&
test_terminal git -c pager.config config foo.bar bar &&
- ! test -e paginated.out
+ test_path_is_missing paginated.out
'
test_expect_success TTY 'git config --edit ignores pager.config' '
@@ -257,33 +257,33 @@ test_expect_success TTY 'git config --edit ignores pager.config' '
touch editor.used
EOF
EDITOR=./editor test_terminal git -c pager.config config --edit &&
- ! test -e paginated.out &&
- test -e editor.used
+ test_path_is_missing paginated.out &&
+ test_path_is_file editor.used
'
test_expect_success TTY 'git config --get ignores pager.config' '
rm -f paginated.out &&
test_terminal git -c pager.config config --get foo.bar &&
- ! test -e paginated.out
+ test_path_is_missing paginated.out
'
test_expect_success TTY 'git config --get-urlmatch defaults to paging' '
rm -f paginated.out &&
test_terminal git -c http."https://foo.com/".bar=foo \
config --get-urlmatch http https://foo.com &&
- test -e paginated.out
+ test_path_is_file paginated.out
'
test_expect_success TTY 'git config --get-all respects pager.config' '
rm -f paginated.out &&
test_terminal git -c pager.config=false config --get-all foo.bar &&
- ! test -e paginated.out
+ test_path_is_missing paginated.out
'
test_expect_success TTY 'git config --list defaults to paging' '
rm -f paginated.out &&
test_terminal git config --list &&
- test -e paginated.out
+ test_path_is_file paginated.out
'
@@ -392,7 +392,7 @@ test_default_pager() {
export PATH &&
$full_command
) &&
- test -e default_pager_used
+ test_path_is_file default_pager_used
"
}
@@ -406,7 +406,7 @@ test_PAGER_overrides() {
PAGER='wc >PAGER_used' &&
export PAGER &&
$full_command &&
- test -e PAGER_used
+ test_path_is_file PAGER_used
"
}
@@ -432,7 +432,7 @@ test_core_pager() {
export PAGER &&
test_config core.pager 'wc >core.pager_used' &&
$full_command &&
- ${if_local_config}test -e core.pager_used
+ ${if_local_config}test_path_is_file core.pager_used
"
}
@@ -464,7 +464,7 @@ test_pager_subdir_helper() {
cd sub &&
$full_command
) &&
- ${if_local_config}test -e core.pager_used
+ ${if_local_config}test_path_is_file core.pager_used
"
}
@@ -477,7 +477,7 @@ test_GIT_PAGER_overrides() {
GIT_PAGER='wc >GIT_PAGER_used' &&
export GIT_PAGER &&
$full_command &&
- test -e GIT_PAGER_used
+ test_path_is_file GIT_PAGER_used
"
}
@@ -489,7 +489,7 @@ test_doesnt_paginate() {
GIT_PAGER='wc >GIT_PAGER_used' &&
export GIT_PAGER &&
$full_command &&
- ! test -e GIT_PAGER_used
+ test_path_is_missing GIT_PAGER_used
"
}
diff --git a/t/t7101-reset-empty-subdirs.sh b/t/t7101-reset-empty-subdirs.sh
index 96e163f..bfce05a 100755
--- a/t/t7101-reset-empty-subdirs.sh
+++ b/t/t7101-reset-empty-subdirs.sh
@@ -6,16 +6,15 @@
test_description='git reset should cull empty subdirs'
. ./test-lib.sh
-test_expect_success \
- 'creating initial files' \
- 'mkdir path0 &&
+test_expect_success 'creating initial files' '
+ mkdir path0 &&
cp "$TEST_DIRECTORY"/../COPYING path0/COPYING &&
git add path0/COPYING &&
- git commit -m add -a'
+ git commit -m add -a
+'
-test_expect_success \
- 'creating second files' \
- 'mkdir path1 &&
+test_expect_success 'creating second files' '
+ mkdir path1 &&
mkdir path1/path2 &&
cp "$TEST_DIRECTORY"/../COPYING path1/path2/COPYING &&
cp "$TEST_DIRECTORY"/../COPYING path1/COPYING &&
@@ -25,39 +24,40 @@ test_expect_success \
git add path1/COPYING &&
git add COPYING &&
git add path0/COPYING-TOO &&
- git commit -m change -a'
+ git commit -m change -a
+'
-test_expect_success \
- 'resetting tree HEAD^' \
- 'git reset --hard HEAD^'
+test_expect_success 'resetting tree HEAD^' '
+ git reset --hard HEAD^
+'
-test_expect_success \
- 'checking initial files exist after rewind' \
- 'test -d path0 &&
- test -f path0/COPYING'
+test_expect_success 'checking initial files exist after rewind' '
+ test -d path0 &&
+ test -f path0/COPYING
+'
-test_expect_success \
- 'checking lack of path1/path2/COPYING' \
- '! test -f path1/path2/COPYING'
+test_expect_success 'checking lack of path1/path2/COPYING' '
+ ! test -f path1/path2/COPYING
+'
-test_expect_success \
- 'checking lack of path1/COPYING' \
- '! test -f path1/COPYING'
+test_expect_success 'checking lack of path1/COPYING' '
+ ! test -f path1/COPYING
+'
-test_expect_success \
- 'checking lack of COPYING' \
- '! test -f COPYING'
+test_expect_success 'checking lack of COPYING' '
+ ! test -f COPYING
+'
-test_expect_success \
- 'checking checking lack of path1/COPYING-TOO' \
- '! test -f path0/COPYING-TOO'
+test_expect_success 'checking checking lack of path1/COPYING-TOO' '
+ ! test -f path0/COPYING-TOO
+'
-test_expect_success \
- 'checking lack of path1/path2' \
- '! test -d path1/path2'
+test_expect_success 'checking lack of path1/path2' '
+ ! test -d path1/path2
+'
-test_expect_success \
- 'checking lack of path1' \
- '! test -d path1'
+test_expect_success 'checking lack of path1' '
+ ! test -d path1
+'
test_done
diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh
index 22161b3..b1affb0 100755
--- a/t/t7102-reset.sh
+++ b/t/t7102-reset.sh
@@ -70,27 +70,27 @@ check_changes () {
test_expect_success 'reset --hard message' '
hex=$(git log -1 --format="%h") &&
- git reset --hard > .actual &&
- echo HEAD is now at $hex $(commit_msg) > .expected &&
+ git reset --hard >.actual &&
+ echo HEAD is now at $hex $(commit_msg) >.expected &&
test_i18ncmp .expected .actual
'
test_expect_success 'reset --hard message (ISO8859-1 logoutputencoding)' '
hex=$(git log -1 --format="%h") &&
- git -c "i18n.logOutputEncoding=$test_encoding" reset --hard > .actual &&
- echo HEAD is now at $hex $(commit_msg $test_encoding) > .expected &&
+ git -c "i18n.logOutputEncoding=$test_encoding" reset --hard >.actual &&
+ echo HEAD is now at $hex $(commit_msg $test_encoding) >.expected &&
test_i18ncmp .expected .actual
'
->.diff_expect
->.cached_expect
-cat >.cat_expect <<EOF
-secondfile:
-1st line 2nd file
-2nd line 2nd file
-EOF
-
test_expect_success 'giving a non existing revision should fail' '
+ >.diff_expect &&
+ >.cached_expect &&
+ cat >.cat_expect <<-\EOF &&
+ secondfile:
+ 1st line 2nd file
+ 2nd line 2nd file
+ EOF
+
test_must_fail git reset aaaaaa &&
test_must_fail git reset --mixed aaaaaa &&
test_must_fail git reset --soft aaaaaa &&
@@ -107,8 +107,7 @@ test_expect_success 'reset --soft with unmerged index should fail' '
git rm --cached -- un
'
-test_expect_success \
- 'giving paths with options different than --mixed should fail' '
+test_expect_success 'giving paths with options different than --mixed should fail' '
test_must_fail git reset --soft -- first &&
test_must_fail git reset --hard -- first &&
test_must_fail git reset --soft HEAD^ -- first &&
@@ -128,8 +127,7 @@ test_expect_success 'giving unrecognized options should fail' '
check_changes $head5
'
-test_expect_success \
- 'trying to do reset --soft with pending merge should fail' '
+test_expect_success 'trying to do reset --soft with pending merge should fail' '
git branch branch1 &&
git branch branch2 &&
@@ -152,8 +150,7 @@ test_expect_success \
check_changes $head5
'
-test_expect_success \
- 'trying to do reset --soft with pending checkout merge should fail' '
+test_expect_success 'trying to do reset --soft with pending checkout merge should fail' '
git branch branch3 &&
git branch branch4 &&
@@ -175,8 +172,7 @@ test_expect_success \
check_changes $head5
'
-test_expect_success \
- 'resetting to HEAD with no changes should succeed and do nothing' '
+test_expect_success 'resetting to HEAD with no changes should succeed and do nothing' '
git reset --hard &&
check_changes $head5 &&
git reset --hard HEAD &&
@@ -195,39 +191,38 @@ test_expect_success \
check_changes $head5
'
->.diff_expect
-cat >.cached_expect <<EOF
-diff --git a/secondfile b/secondfile
-index $head5p1s..$head5s 100644
---- a/secondfile
-+++ b/secondfile
-@@ -1 +1,2 @@
--2nd file
-+1st line 2nd file
-+2nd line 2nd file
-EOF
-cat >.cat_expect <<EOF
-secondfile:
-1st line 2nd file
-2nd line 2nd file
-EOF
test_expect_success '--soft reset only should show changes in diff --cached' '
+ >.diff_expect &&
+ cat >.cached_expect <<-EOF &&
+ diff --git a/secondfile b/secondfile
+ index $head5p1s..$head5s 100644
+ --- a/secondfile
+ +++ b/secondfile
+ @@ -1 +1,2 @@
+ -2nd file
+ +1st line 2nd file
+ +2nd line 2nd file
+ EOF
+ cat >.cat_expect <<-\EOF &&
+ secondfile:
+ 1st line 2nd file
+ 2nd line 2nd file
+ EOF
git reset --soft HEAD^ &&
check_changes $head5p1 &&
test "$(git rev-parse ORIG_HEAD)" = \
$head5
'
->.diff_expect
->.cached_expect
-cat >.cat_expect <<EOF
-secondfile:
-1st line 2nd file
-2nd line 2nd file
-3rd line 2nd file
-EOF
-test_expect_success \
- 'changing files and redo the last commit should succeed' '
+test_expect_success 'changing files and redo the last commit should succeed' '
+ >.diff_expect &&
+ >.cached_expect &&
+ cat >.cat_expect <<-\EOF &&
+ secondfile:
+ 1st line 2nd file
+ 2nd line 2nd file
+ 3rd line 2nd file
+ EOF
echo "3rd line 2nd file" >>secondfile &&
git commit -a -C ORIG_HEAD &&
head4=$(git rev-parse --verify HEAD) &&
@@ -236,56 +231,54 @@ test_expect_success \
$head5
'
->.diff_expect
->.cached_expect
-cat >.cat_expect <<EOF
-first:
-1st file
-2nd line 1st file
-second:
-2nd file
-EOF
-test_expect_success \
- '--hard reset should change the files and undo commits permanently' '
+test_expect_success '--hard reset should change the files and undo commits permanently' '
+ >.diff_expect &&
+ >.cached_expect &&
+ cat >.cat_expect <<-\EOF &&
+ first:
+ 1st file
+ 2nd line 1st file
+ second:
+ 2nd file
+ EOF
git reset --hard HEAD~2 &&
check_changes $head5p2 &&
test "$(git rev-parse ORIG_HEAD)" = \
$head4
'
->.diff_expect
-cat >.cached_expect <<EOF
-diff --git a/first b/first
-deleted file mode 100644
-index $head5p2f..0000000
---- a/first
-+++ /dev/null
-@@ -1,2 +0,0 @@
--1st file
--2nd line 1st file
-diff --git a/second b/second
-deleted file mode 100644
-index $head5p1s..0000000
---- a/second
-+++ /dev/null
-@@ -1 +0,0 @@
--2nd file
-diff --git a/secondfile b/secondfile
-new file mode 100644
-index 0000000..$head5s
---- /dev/null
-+++ b/secondfile
-@@ -0,0 +1,2 @@
-+1st line 2nd file
-+2nd line 2nd file
-EOF
-cat >.cat_expect <<EOF
-secondfile:
-1st line 2nd file
-2nd line 2nd file
-EOF
-test_expect_success \
- 'redoing changes adding them without commit them should succeed' '
+test_expect_success 'redoing changes adding them without commit them should succeed' '
+ >.diff_expect &&
+ cat >.cached_expect <<-EOF &&
+ diff --git a/first b/first
+ deleted file mode 100644
+ index $head5p2f..0000000
+ --- a/first
+ +++ /dev/null
+ @@ -1,2 +0,0 @@
+ -1st file
+ -2nd line 1st file
+ diff --git a/second b/second
+ deleted file mode 100644
+ index $head5p1s..0000000
+ --- a/second
+ +++ /dev/null
+ @@ -1 +0,0 @@
+ -2nd file
+ diff --git a/secondfile b/secondfile
+ new file mode 100644
+ index 0000000..$head5s
+ --- /dev/null
+ +++ b/secondfile
+ @@ -0,0 +1,2 @@
+ +1st line 2nd file
+ +2nd line 2nd file
+ EOF
+ cat >.cat_expect <<-\EOF &&
+ secondfile:
+ 1st line 2nd file
+ 2nd line 2nd file
+ EOF
git rm first &&
git mv second secondfile &&
@@ -295,46 +288,45 @@ test_expect_success \
check_changes $head5p2
'
-cat >.diff_expect <<EOF
-diff --git a/first b/first
-deleted file mode 100644
-index $head5p2f..0000000
---- a/first
-+++ /dev/null
-@@ -1,2 +0,0 @@
--1st file
--2nd line 1st file
-diff --git a/second b/second
-deleted file mode 100644
-index $head5p1s..0000000
---- a/second
-+++ /dev/null
-@@ -1 +0,0 @@
--2nd file
-EOF
->.cached_expect
-cat >.cat_expect <<EOF
-secondfile:
-1st line 2nd file
-2nd line 2nd file
-EOF
test_expect_success '--mixed reset to HEAD should unadd the files' '
+ cat >.diff_expect <<-EOF &&
+ diff --git a/first b/first
+ deleted file mode 100644
+ index $head5p2f..0000000
+ --- a/first
+ +++ /dev/null
+ @@ -1,2 +0,0 @@
+ -1st file
+ -2nd line 1st file
+ diff --git a/second b/second
+ deleted file mode 100644
+ index $head5p1s..0000000
+ --- a/second
+ +++ /dev/null
+ @@ -1 +0,0 @@
+ -2nd file
+ EOF
+ >.cached_expect &&
+ cat >.cat_expect <<-\EOF &&
+ secondfile:
+ 1st line 2nd file
+ 2nd line 2nd file
+ EOF
git reset &&
check_changes $head5p2 &&
test "$(git rev-parse ORIG_HEAD)" = $head5p2
'
->.diff_expect
->.cached_expect
-cat >.cat_expect <<EOF
-secondfile:
-1st line 2nd file
-2nd line 2nd file
-EOF
test_expect_success 'redoing the last two commits should succeed' '
+ >.diff_expect &&
+ >.cached_expect &&
+ cat >.cat_expect <<-\EOF &&
+ secondfile:
+ 1st line 2nd file
+ 2nd line 2nd file
+ EOF
git add secondfile &&
git reset --hard $head5p2 &&
-
git rm first &&
git mv second secondfile &&
git commit -a -m "remove 1st and rename 2nd" &&
@@ -347,15 +339,15 @@ test_expect_success 'redoing the last two commits should succeed' '
check_changes $head5
'
->.diff_expect
->.cached_expect
-cat >.cat_expect <<EOF
-secondfile:
-1st line 2nd file
-2nd line 2nd file
-3rd line in branch2
-EOF
test_expect_success '--hard reset to HEAD should clear a failed merge' '
+ >.diff_expect &&
+ >.cached_expect &&
+ cat >.cat_expect <<-\EOF &&
+ secondfile:
+ 1st line 2nd file
+ 2nd line 2nd file
+ 3rd line in branch2
+ EOF
git branch branch1 &&
git branch branch2 &&
@@ -373,15 +365,14 @@ test_expect_success '--hard reset to HEAD should clear a failed merge' '
check_changes $head3
'
->.diff_expect
->.cached_expect
-cat >.cat_expect <<EOF
-secondfile:
-1st line 2nd file
-2nd line 2nd file
-EOF
-test_expect_success \
- '--hard reset to ORIG_HEAD should clear a fast-forward merge' '
+test_expect_success '--hard reset to ORIG_HEAD should clear a fast-forward merge' '
+ >.diff_expect &&
+ >.cached_expect &&
+ cat >.cat_expect <<-\EOF &&
+ secondfile:
+ 1st line 2nd file
+ 2nd line 2nd file
+ EOF
git reset --hard HEAD^ &&
check_changes $head5 &&
@@ -395,25 +386,25 @@ test_expect_success \
'
test_expect_success 'test --mixed <paths>' '
- echo 1 > file1 &&
- echo 2 > file2 &&
+ echo 1 >file1 &&
+ echo 2 >file2 &&
git add file1 file2 &&
test_tick &&
git commit -m files &&
before1=$(git rev-parse --short HEAD:file1) &&
before2=$(git rev-parse --short HEAD:file2) &&
git rm file2 &&
- echo 3 > file3 &&
- echo 4 > file4 &&
- echo 5 > file1 &&
+ echo 3 >file3 &&
+ echo 4 >file4 &&
+ echo 5 >file1 &&
after1=$(git rev-parse --short $(git hash-object file1)) &&
after4=$(git rev-parse --short $(git hash-object file4)) &&
git add file1 file3 file4 &&
git reset HEAD -- file1 file2 file3 &&
test_must_fail git diff --quiet &&
- git diff > output &&
+ git diff >output &&
- cat > expect <<-EOF &&
+ cat >expect <<-EOF &&
diff --git a/file1 b/file1
index $before1..$after1 100644
--- a/file1
@@ -431,9 +422,9 @@ test_expect_success 'test --mixed <paths>' '
EOF
test_cmp expect output &&
- git diff --cached > output &&
+ git diff --cached >output &&
- cat > cached_expect <<-EOF &&
+ cat >cached_expect <<-EOF &&
diff --git a/file4 b/file4
new file mode 100644
index 0000000..$after4
@@ -447,7 +438,6 @@ test_expect_success 'test --mixed <paths>' '
'
test_expect_success 'test resetting the index at give paths' '
-
mkdir sub &&
>sub/file1 &&
>sub/file2 &&
@@ -460,7 +450,6 @@ test_expect_success 'test resetting the index at give paths' '
echo "$U" &&
test_must_fail git diff-index --cached --exit-code "$T" &&
test "$T" != "$U"
-
'
test_expect_success 'resetting an unmodified path is a no-op' '
@@ -470,14 +459,13 @@ test_expect_success 'resetting an unmodified path is a no-op' '
git diff-index --cached --exit-code HEAD
'
-cat > expect << EOF
-Unstaged changes after reset:
-M file2
-EOF
-
test_expect_success '--mixed refreshes the index' '
- echo 123 >> file2 &&
- git reset --mixed HEAD > output &&
+ cat >expect <<-\EOF &&
+ Unstaged changes after reset:
+ M file2
+ EOF
+ echo 123 >>file2 &&
+ git reset --mixed HEAD >output &&
test_i18ncmp expect output
'
@@ -498,7 +486,6 @@ test_expect_success 'resetting specific path that is unmerged' '
'
test_expect_success 'disambiguation (1)' '
-
git reset --hard &&
>secondfile &&
git add secondfile &&
@@ -507,11 +494,9 @@ test_expect_success 'disambiguation (1)' '
test -z "$(git diff --cached --name-only)" &&
test -f secondfile &&
test_must_be_empty secondfile
-
'
test_expect_success 'disambiguation (2)' '
-
git reset --hard &&
>secondfile &&
git add secondfile &&
@@ -519,11 +504,9 @@ test_expect_success 'disambiguation (2)' '
test_must_fail git reset secondfile &&
test -n "$(git diff --cached --name-only -- secondfile)" &&
test ! -f secondfile
-
'
test_expect_success 'disambiguation (3)' '
-
git reset --hard &&
>secondfile &&
git add secondfile &&
@@ -532,11 +515,9 @@ test_expect_success 'disambiguation (3)' '
test_must_fail git diff --quiet &&
test -z "$(git diff --cached --name-only)" &&
test ! -f secondfile
-
'
test_expect_success 'disambiguation (4)' '
-
git reset --hard &&
>secondfile &&
git add secondfile &&
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index 4d62b9b..b36a930 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -33,8 +33,7 @@ fill () {
test_expect_success setup '
-
- fill x y z > same &&
+ fill x y z >same &&
fill 1 2 3 4 5 6 7 8 >one &&
fill a b c d e >two &&
git add same one two &&
@@ -56,14 +55,13 @@ test_expect_success setup '
git checkout -b simple master &&
rm -f one &&
- fill a c e > two &&
+ fill a c e >two &&
git commit -a -m "Simple D one, M two" &&
git checkout master
'
-test_expect_success "checkout from non-existing branch" '
-
+test_expect_success 'checkout from non-existing branch' '
git checkout -b delete-me master &&
git update-ref -d --no-deref refs/heads/delete-me &&
test refs/heads/delete-me = "$(git symbolic-ref HEAD)" &&
@@ -71,8 +69,7 @@ test_expect_success "checkout from non-existing branch" '
test refs/heads/master = "$(git symbolic-ref HEAD)"
'
-test_expect_success "checkout with dirty tree without -m" '
-
+test_expect_success 'checkout with dirty tree without -m' '
fill 0 1 2 3 4 5 6 7 8 >one &&
if git checkout side
then
@@ -81,11 +78,9 @@ test_expect_success "checkout with dirty tree without -m" '
else
echo "happy - failed correctly"
fi
-
'
-test_expect_success "checkout with unrelated dirty tree without -m" '
-
+test_expect_success 'checkout with unrelated dirty tree without -m' '
git checkout -f master &&
fill 0 1 2 3 4 5 6 7 8 >same &&
cp same kept &&
@@ -95,13 +90,12 @@ test_expect_success "checkout with unrelated dirty tree without -m" '
test_cmp messages.expect messages
'
-test_expect_success "checkout -m with dirty tree" '
-
+test_expect_success 'checkout -m with dirty tree' '
git checkout -f master &&
git clean -f &&
fill 0 1 2 3 4 5 6 7 8 >one &&
- git checkout -m side > messages &&
+ git checkout -m side >messages &&
test "$(git symbolic-ref HEAD)" = "refs/heads/side" &&
@@ -120,8 +114,7 @@ test_expect_success "checkout -m with dirty tree" '
test_must_be_empty current.index
'
-test_expect_success "checkout -m with dirty tree, renamed" '
-
+test_expect_success 'checkout -m with dirty tree, renamed' '
git checkout -f master && git clean -f &&
fill 1 2 3 4 5 7 8 >one &&
@@ -139,11 +132,9 @@ test_expect_success "checkout -m with dirty tree, renamed" '
! test -f one &&
git diff --cached >current &&
test_must_be_empty current
-
'
test_expect_success 'checkout -m with merge conflict' '
-
git checkout -f master && git clean -f &&
fill 1 T 3 4 5 6 S 8 >one &&
@@ -166,10 +157,10 @@ test_expect_success 'checkout -m with merge conflict' '
'
test_expect_success 'format of merge conflict from checkout -m' '
+ git checkout -f master &&
+ git clean -f &&
- git checkout -f master && git clean -f &&
-
- fill b d > two &&
+ fill b d >two &&
git checkout -m simple &&
git ls-files >current &&
@@ -190,10 +181,11 @@ test_expect_success 'format of merge conflict from checkout -m' '
'
test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
+ git checkout -f master &&
+ git reset --hard &&
+ git clean -f &&
- git checkout -f master && git reset --hard && git clean -f &&
-
- fill b d > two &&
+ fill b d >two &&
git checkout --merge --conflict=diff3 simple &&
cat <<-EOF >expect &&
@@ -216,8 +208,9 @@ test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
'
test_expect_success 'switch to another branch while carrying a deletion' '
-
- git checkout -f master && git reset --hard && git clean -f &&
+ git checkout -f master &&
+ git reset --hard &&
+ git clean -f &&
git rm two &&
test_must_fail git checkout simple 2>errs &&
@@ -228,10 +221,10 @@ test_expect_success 'switch to another branch while carrying a deletion' '
'
test_expect_success 'checkout to detach HEAD (with advice declined)' '
-
git config advice.detachedHead false &&
rev=$(git rev-parse --short renamer^) &&
- git checkout -f renamer && git clean -f &&
+ git checkout -f renamer &&
+ git clean -f &&
git checkout renamer^ 2>messages &&
test_i18ngrep "HEAD is now at $rev" messages &&
test_line_count = 1 messages &&
@@ -250,7 +243,8 @@ test_expect_success 'checkout to detach HEAD (with advice declined)' '
test_expect_success 'checkout to detach HEAD' '
git config advice.detachedHead true &&
rev=$(git rev-parse --short renamer^) &&
- git checkout -f renamer && git clean -f &&
+ git checkout -f renamer &&
+ git clean -f &&
GIT_TEST_GETTEXT_POISON=false git checkout renamer^ 2>messages &&
grep "HEAD is now at $rev" messages &&
test_line_count -gt 1 messages &&
@@ -267,8 +261,8 @@ test_expect_success 'checkout to detach HEAD' '
'
test_expect_success 'checkout to detach HEAD with branchname^' '
-
- git checkout -f master && git clean -f &&
+ git checkout -f master &&
+ git clean -f &&
git checkout renamer^ &&
H=$(git rev-parse --verify HEAD) &&
M=$(git show-ref -s --verify refs/heads/master) &&
@@ -283,8 +277,8 @@ test_expect_success 'checkout to detach HEAD with branchname^' '
'
test_expect_success 'checkout to detach HEAD with :/message' '
-
- git checkout -f master && git clean -f &&
+ git checkout -f master &&
+ git clean -f &&
git checkout ":/Initial" &&
H=$(git rev-parse --verify HEAD) &&
M=$(git show-ref -s --verify refs/heads/master) &&
@@ -299,8 +293,8 @@ test_expect_success 'checkout to detach HEAD with :/message' '
'
test_expect_success 'checkout to detach HEAD with HEAD^0' '
-
- git checkout -f master && git clean -f &&
+ git checkout -f master &&
+ git clean -f &&
git checkout HEAD^0 &&
H=$(git rev-parse --verify HEAD) &&
M=$(git show-ref -s --verify refs/heads/master) &&
@@ -315,7 +309,6 @@ test_expect_success 'checkout to detach HEAD with HEAD^0' '
'
test_expect_success 'checkout with ambiguous tag/branch names' '
-
git tag both side &&
git branch both master &&
git reset --hard &&
@@ -327,11 +320,9 @@ test_expect_success 'checkout with ambiguous tag/branch names' '
test "z$H" = "z$M" &&
name=$(git symbolic-ref HEAD 2>/dev/null) &&
test "z$name" = zrefs/heads/both
-
'
test_expect_success 'checkout with ambiguous tag/branch names' '
-
git reset --hard &&
git checkout master &&
@@ -351,26 +342,19 @@ test_expect_success 'checkout with ambiguous tag/branch names' '
else
: happy
fi
-
'
test_expect_success 'switch branches while in subdirectory' '
-
git reset --hard &&
git checkout master &&
mkdir subs &&
- (
- cd subs &&
- git checkout side
- ) &&
+ git -C subs checkout side &&
! test -f subs/one &&
rm -fr subs
-
'
test_expect_success 'checkout specific path while in subdirectory' '
-
git reset --hard &&
git checkout side &&
mkdir subs &&
@@ -380,30 +364,26 @@ test_expect_success 'checkout specific path while in subdirectory' '
git checkout master &&
mkdir -p subs &&
- (
- cd subs &&
- git checkout side -- bero
- ) &&
+ git -C subs checkout side -- bero &&
test -f subs/bero
-
'
-test_expect_success \
- 'checkout w/--track sets up tracking' '
+test_expect_success 'checkout w/--track sets up tracking' '
git config branch.autosetupmerge false &&
git checkout master &&
git checkout --track -b track1 &&
test "$(git config branch.track1.remote)" &&
- test "$(git config branch.track1.merge)"'
+ test "$(git config branch.track1.merge)"
+'
-test_expect_success \
- 'checkout w/autosetupmerge=always sets up tracking' '
+test_expect_success 'checkout w/autosetupmerge=always sets up tracking' '
test_when_finished git config branch.autosetupmerge false &&
git config branch.autosetupmerge always &&
git checkout master &&
git checkout -b track2 &&
test "$(git config branch.track2.remote)" &&
- test "$(git config branch.track2.merge)"'
+ test "$(git config branch.track2.merge)"
+'
test_expect_success 'checkout w/--track from non-branch HEAD fails' '
git checkout master^0 &&
@@ -435,8 +415,7 @@ test_expect_success 'detach a symbolic link HEAD' '
test "z$(git rev-parse --verify refs/heads/master)" = "z$here"
'
-test_expect_success \
- 'checkout with --track fakes a sensible -b <name>' '
+test_expect_success 'checkout with --track fakes a sensible -b <name>' '
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" &&
git update-ref refs/remotes/origin/koala/bear renamer &&
@@ -457,9 +436,9 @@ test_expect_success \
test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)"
'
-test_expect_success \
- 'checkout with --track, but without -b, fails with too short tracked name' '
- test_must_fail git checkout --track renamer'
+test_expect_success 'checkout with --track, but without -b, fails with too short tracked name' '
+ test_must_fail git checkout --track renamer
+'
setup_conflicting_index () {
rm -f .git/index &&
@@ -609,7 +588,6 @@ test_expect_success 'failing checkout -b should not break working tree' '
test $(git symbolic-ref HEAD) = refs/heads/master &&
git diff --exit-code &&
git diff --cached --exit-code
-
'
test_expect_success 'switch out of non-branch' '
diff --git a/t/t7518-ident-corner-cases.sh b/t/t7518-ident-corner-cases.sh
index dc3e9c8..905957b 100755
--- a/t/t7518-ident-corner-cases.sh
+++ b/t/t7518-ident-corner-cases.sh
@@ -13,7 +13,7 @@ test_expect_success 'empty name and missing email' '
sane_unset GIT_AUTHOR_EMAIL &&
GIT_AUTHOR_NAME= &&
test_must_fail git commit --allow-empty -m foo 2>err &&
- test_i18ngrep ! null err
+ test_i18ngrep ! "(null)" err
)
'
diff --git a/t/t7602-merge-octopus-many.sh b/t/t7602-merge-octopus-many.sh
index 6abe441..13859ec 100755
--- a/t/t7602-merge-octopus-many.sh
+++ b/t/t7602-merge-octopus-many.sh
@@ -77,6 +77,12 @@ Merge made by the 'recursive' strategy.
EOF
test_expect_success 'merge reduces irrelevant remote heads' '
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ mv expected expected.tmp &&
+ sed s/recursive/ort/ expected.tmp >expected &&
+ rm expected.tmp
+ fi &&
GIT_MERGE_VERBOSITY=0 git merge c4 c5 >actual &&
test_i18ncmp expected actual
'
diff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh
index ad288dd..70afdd0 100755
--- a/t/t7610-mergetool.sh
+++ b/t/t7610-mergetool.sh
@@ -532,7 +532,14 @@ test_expect_success 'file vs modified submodule' '
yes "" | git mergetool file1 file2 spaced\ name subdir/file3 &&
yes "" | git mergetool both &&
yes "d" | git mergetool file11 file12 &&
- yes "l" | git mergetool submod &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ yes "c" | git mergetool submod~HEAD &&
+ git rm submod &&
+ git mv submod~HEAD submod
+ else
+ yes "l" | git mergetool submod
+ fi &&
git submodule update -N &&
echo "not a submodule" >expect &&
test_cmp expect submod &&
@@ -549,7 +556,15 @@ test_expect_success 'file vs modified submodule' '
yes "" | git mergetool file1 file2 spaced\ name subdir/file3 &&
yes "" | git mergetool both &&
yes "d" | git mergetool file11 file12 &&
- yes "r" | git mergetool submod &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ mv submod submod.orig &&
+ git rm --cached submod &&
+ yes "c" | git mergetool submod~test19 &&
+ git mv submod~test19 submod
+ else
+ yes "r" | git mergetool submod
+ fi &&
test -d submod.orig &&
git submodule update -N &&
echo "not a submodule" >expect &&
@@ -567,6 +582,10 @@ test_expect_success 'file vs modified submodule' '
yes "" | git mergetool both &&
yes "d" | git mergetool file11 file12 &&
yes "l" | git mergetool submod &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ yes "d" | git mergetool submod~test19
+ fi &&
echo "master submodule" >expect &&
test_cmp expect submod/bar &&
git submodule update -N &&
@@ -664,7 +683,14 @@ test_expect_success 'directory vs modified submodule' '
test_must_fail git merge master &&
test -n "$(git ls-files -u)" &&
test ! -e submod.orig &&
- yes "r" | git mergetool submod &&
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ yes "r" | git mergetool submod~master &&
+ git mv submod submod.orig &&
+ git mv submod~master submod
+ else
+ yes "r" | git mergetool submod
+ fi &&
test -d submod.orig &&
echo "not a submodule" >expect &&
test_cmp expect submod.orig/file16 &&
diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh
index 53c8835..d9e68bb 100755
--- a/t/t7900-maintenance.sh
+++ b/t/t7900-maintenance.sh
@@ -5,10 +5,11 @@ test_description='git maintenance builtin'
. ./test-lib.sh
GIT_TEST_COMMIT_GRAPH=0
+GIT_TEST_MULTI_PACK_INDEX=0
test_expect_success 'help text' '
test_expect_code 129 git maintenance -h 2>err &&
- test_i18ngrep "usage: git maintenance run" err &&
+ test_i18ngrep "usage: git maintenance <subcommand>" err &&
test_expect_code 128 git maintenance barf 2>err &&
test_i18ngrep "invalid subcommand: barf" err &&
test_expect_code 129 git maintenance 2>err &&
@@ -27,6 +28,19 @@ test_expect_success 'run [--auto|--quiet]' '
test_subcommand git gc --no-quiet <run-no-quiet.txt
'
+test_expect_success 'maintenance.auto config option' '
+ GIT_TRACE2_EVENT="$(pwd)/default" git commit --quiet --allow-empty -m 1 &&
+ test_subcommand git maintenance run --auto --quiet <default &&
+ GIT_TRACE2_EVENT="$(pwd)/true" \
+ git -c maintenance.auto=true \
+ commit --quiet --allow-empty -m 2 &&
+ test_subcommand git maintenance run --auto --quiet <true &&
+ GIT_TRACE2_EVENT="$(pwd)/false" \
+ git -c maintenance.auto=false \
+ commit --quiet --allow-empty -m 3 &&
+ test_subcommand ! git maintenance run --auto --quiet <false
+'
+
test_expect_success 'maintenance.<task>.enabled' '
git config maintenance.gc.enabled false &&
git config maintenance.commit-graph.enabled true &&
@@ -52,6 +66,43 @@ test_expect_success 'run --task=<task>' '
test_subcommand git commit-graph write --split --reachable --no-progress <run-both.txt
'
+test_expect_success 'core.commitGraph=false prevents write process' '
+ GIT_TRACE2_EVENT="$(pwd)/no-commit-graph.txt" \
+ git -c core.commitGraph=false maintenance run \
+ --task=commit-graph 2>/dev/null &&
+ test_subcommand ! git commit-graph write --split --reachable --no-progress \
+ <no-commit-graph.txt
+'
+
+test_expect_success 'commit-graph auto condition' '
+ COMMAND="maintenance run --task=commit-graph --auto --quiet" &&
+
+ GIT_TRACE2_EVENT="$(pwd)/cg-no.txt" \
+ git -c maintenance.commit-graph.auto=1 $COMMAND &&
+ GIT_TRACE2_EVENT="$(pwd)/cg-negative-means-yes.txt" \
+ git -c maintenance.commit-graph.auto="-1" $COMMAND &&
+
+ test_commit first &&
+
+ GIT_TRACE2_EVENT="$(pwd)/cg-zero-means-no.txt" \
+ git -c maintenance.commit-graph.auto=0 $COMMAND &&
+ GIT_TRACE2_EVENT="$(pwd)/cg-one-satisfied.txt" \
+ git -c maintenance.commit-graph.auto=1 $COMMAND &&
+
+ git commit --allow-empty -m "second" &&
+ git commit --allow-empty -m "third" &&
+
+ GIT_TRACE2_EVENT="$(pwd)/cg-two-satisfied.txt" \
+ git -c maintenance.commit-graph.auto=2 $COMMAND &&
+
+ COMMIT_GRAPH_WRITE="git commit-graph write --split --reachable --no-progress" &&
+ test_subcommand ! $COMMIT_GRAPH_WRITE <cg-no.txt &&
+ test_subcommand $COMMIT_GRAPH_WRITE <cg-negative-means-yes.txt &&
+ test_subcommand ! $COMMIT_GRAPH_WRITE <cg-zero-means-no.txt &&
+ test_subcommand $COMMIT_GRAPH_WRITE <cg-one-satisfied.txt &&
+ test_subcommand $COMMIT_GRAPH_WRITE <cg-two-satisfied.txt
+'
+
test_expect_success 'run --task=bogus' '
test_must_fail git maintenance run --task=bogus 2>err &&
test_i18ngrep "is not a valid task" err
@@ -62,4 +113,332 @@ test_expect_success 'run --task duplicate' '
test_i18ngrep "cannot be selected multiple times" err
'
+test_expect_success 'run --task=prefetch with no remotes' '
+ git maintenance run --task=prefetch 2>err &&
+ test_must_be_empty err
+'
+
+test_expect_success 'prefetch multiple remotes' '
+ git clone . clone1 &&
+ git clone . clone2 &&
+ git remote add remote1 "file://$(pwd)/clone1" &&
+ git remote add remote2 "file://$(pwd)/clone2" &&
+ git -C clone1 switch -c one &&
+ git -C clone2 switch -c two &&
+ test_commit -C clone1 one &&
+ test_commit -C clone2 two &&
+ GIT_TRACE2_EVENT="$(pwd)/run-prefetch.txt" git maintenance run --task=prefetch 2>/dev/null &&
+ fetchargs="--prune --no-tags --no-write-fetch-head --recurse-submodules=no --refmap= --quiet" &&
+ test_subcommand git fetch remote1 $fetchargs +refs/heads/\\*:refs/prefetch/remote1/\\* <run-prefetch.txt &&
+ test_subcommand git fetch remote2 $fetchargs +refs/heads/\\*:refs/prefetch/remote2/\\* <run-prefetch.txt &&
+ test_path_is_missing .git/refs/remotes &&
+ git log prefetch/remote1/one &&
+ git log prefetch/remote2/two &&
+ git fetch --all &&
+ test_cmp_rev refs/remotes/remote1/one refs/prefetch/remote1/one &&
+ test_cmp_rev refs/remotes/remote2/two refs/prefetch/remote2/two
+'
+
+test_expect_success 'loose-objects task' '
+ # Repack everything so we know the state of the object dir
+ git repack -adk &&
+
+ # Hack to stop maintenance from running during "git commit"
+ echo in use >.git/objects/maintenance.lock &&
+
+ # Assuming that "git commit" creates at least one loose object
+ test_commit create-loose-object &&
+ rm .git/objects/maintenance.lock &&
+
+ ls .git/objects >obj-dir-before &&
+ test_file_not_empty obj-dir-before &&
+ ls .git/objects/pack/*.pack >packs-before &&
+ test_line_count = 1 packs-before &&
+
+ # The first run creates a pack-file
+ # but does not delete loose objects.
+ git maintenance run --task=loose-objects &&
+ ls .git/objects >obj-dir-between &&
+ test_cmp obj-dir-before obj-dir-between &&
+ ls .git/objects/pack/*.pack >packs-between &&
+ test_line_count = 2 packs-between &&
+ ls .git/objects/pack/loose-*.pack >loose-packs &&
+ test_line_count = 1 loose-packs &&
+
+ # The second run deletes loose objects
+ # but does not create a pack-file.
+ git maintenance run --task=loose-objects &&
+ ls .git/objects >obj-dir-after &&
+ cat >expect <<-\EOF &&
+ info
+ pack
+ EOF
+ test_cmp expect obj-dir-after &&
+ ls .git/objects/pack/*.pack >packs-after &&
+ test_cmp packs-between packs-after
+'
+
+test_expect_success 'maintenance.loose-objects.auto' '
+ git repack -adk &&
+ GIT_TRACE2_EVENT="$(pwd)/trace-lo1.txt" \
+ git -c maintenance.loose-objects.auto=1 maintenance \
+ run --auto --task=loose-objects 2>/dev/null &&
+ test_subcommand ! git prune-packed --quiet <trace-lo1.txt &&
+ printf data-A | git hash-object -t blob --stdin -w &&
+ GIT_TRACE2_EVENT="$(pwd)/trace-loA" \
+ git -c maintenance.loose-objects.auto=2 \
+ maintenance run --auto --task=loose-objects 2>/dev/null &&
+ test_subcommand ! git prune-packed --quiet <trace-loA &&
+ printf data-B | git hash-object -t blob --stdin -w &&
+ GIT_TRACE2_EVENT="$(pwd)/trace-loB" \
+ git -c maintenance.loose-objects.auto=2 \
+ maintenance run --auto --task=loose-objects 2>/dev/null &&
+ test_subcommand git prune-packed --quiet <trace-loB &&
+ GIT_TRACE2_EVENT="$(pwd)/trace-loC" \
+ git -c maintenance.loose-objects.auto=2 \
+ maintenance run --auto --task=loose-objects 2>/dev/null &&
+ test_subcommand git prune-packed --quiet <trace-loC
+'
+
+test_expect_success 'incremental-repack task' '
+ packDir=.git/objects/pack &&
+ for i in $(test_seq 1 5)
+ do
+ test_commit $i || return 1
+ done &&
+
+ # Create three disjoint pack-files with size BIG, small, small.
+ echo HEAD~2 | git pack-objects --revs $packDir/test-1 &&
+ test_tick &&
+ git pack-objects --revs $packDir/test-2 <<-\EOF &&
+ HEAD~1
+ ^HEAD~2
+ EOF
+ test_tick &&
+ git pack-objects --revs $packDir/test-3 <<-\EOF &&
+ HEAD
+ ^HEAD~1
+ EOF
+ rm -f $packDir/pack-* &&
+ rm -f $packDir/loose-* &&
+ ls $packDir/*.pack >packs-before &&
+ test_line_count = 3 packs-before &&
+
+ # the job repacks the two into a new pack, but does not
+ # delete the old ones.
+ git maintenance run --task=incremental-repack &&
+ ls $packDir/*.pack >packs-between &&
+ test_line_count = 4 packs-between &&
+
+ # the job deletes the two old packs, and does not write
+ # a new one because the batch size is not high enough to
+ # pack the largest pack-file.
+ git maintenance run --task=incremental-repack &&
+ ls .git/objects/pack/*.pack >packs-after &&
+ test_line_count = 2 packs-after
+'
+
+test_expect_success EXPENSIVE 'incremental-repack 2g limit' '
+ for i in $(test_seq 1 5)
+ do
+ test-tool genrandom foo$i $((512 * 1024 * 1024 + 1)) >>big ||
+ return 1
+ done &&
+ git add big &&
+ git commit -m "Add big file (1)" &&
+
+ # ensure any possible loose objects are in a pack-file
+ git maintenance run --task=loose-objects &&
+
+ rm big &&
+ for i in $(test_seq 6 10)
+ do
+ test-tool genrandom foo$i $((512 * 1024 * 1024 + 1)) >>big ||
+ return 1
+ done &&
+ git add big &&
+ git commit -m "Add big file (2)" &&
+
+ # ensure any possible loose objects are in a pack-file
+ git maintenance run --task=loose-objects &&
+
+ # Now run the incremental-repack task and check the batch-size
+ GIT_TRACE2_EVENT="$(pwd)/run-2g.txt" git maintenance run \
+ --task=incremental-repack 2>/dev/null &&
+ test_subcommand git multi-pack-index repack \
+ --no-progress --batch-size=2147483647 <run-2g.txt
+'
+
+test_expect_success 'maintenance.incremental-repack.auto' '
+ git repack -adk &&
+ git config core.multiPackIndex true &&
+ git multi-pack-index write &&
+ GIT_TRACE2_EVENT="$(pwd)/midx-init.txt" git \
+ -c maintenance.incremental-repack.auto=1 \
+ maintenance run --auto --task=incremental-repack 2>/dev/null &&
+ test_subcommand ! git multi-pack-index write --no-progress <midx-init.txt &&
+ test_commit A &&
+ git pack-objects --revs .git/objects/pack/pack <<-\EOF &&
+ HEAD
+ ^HEAD~1
+ EOF
+ GIT_TRACE2_EVENT=$(pwd)/trace-A git \
+ -c maintenance.incremental-repack.auto=2 \
+ maintenance run --auto --task=incremental-repack 2>/dev/null &&
+ test_subcommand ! git multi-pack-index write --no-progress <trace-A &&
+ test_commit B &&
+ git pack-objects --revs .git/objects/pack/pack <<-\EOF &&
+ HEAD
+ ^HEAD~1
+ EOF
+ GIT_TRACE2_EVENT=$(pwd)/trace-B git \
+ -c maintenance.incremental-repack.auto=2 \
+ maintenance run --auto --task=incremental-repack 2>/dev/null &&
+ test_subcommand git multi-pack-index write --no-progress <trace-B
+'
+
+test_expect_success '--auto and --schedule incompatible' '
+ test_must_fail git maintenance run --auto --schedule=daily 2>err &&
+ test_i18ngrep "at most one" err
+'
+
+test_expect_success 'invalid --schedule value' '
+ test_must_fail git maintenance run --schedule=annually 2>err &&
+ test_i18ngrep "unrecognized --schedule" err
+'
+
+test_expect_success '--schedule inheritance weekly -> daily -> hourly' '
+ git config maintenance.loose-objects.enabled true &&
+ git config maintenance.loose-objects.schedule hourly &&
+ git config maintenance.commit-graph.enabled true &&
+ git config maintenance.commit-graph.schedule daily &&
+ git config maintenance.incremental-repack.enabled true &&
+ git config maintenance.incremental-repack.schedule weekly &&
+
+ GIT_TRACE2_EVENT="$(pwd)/hourly.txt" \
+ git maintenance run --schedule=hourly 2>/dev/null &&
+ test_subcommand git prune-packed --quiet <hourly.txt &&
+ test_subcommand ! git commit-graph write --split --reachable \
+ --no-progress <hourly.txt &&
+ test_subcommand ! git multi-pack-index write --no-progress <hourly.txt &&
+
+ GIT_TRACE2_EVENT="$(pwd)/daily.txt" \
+ git maintenance run --schedule=daily 2>/dev/null &&
+ test_subcommand git prune-packed --quiet <daily.txt &&
+ test_subcommand git commit-graph write --split --reachable \
+ --no-progress <daily.txt &&
+ test_subcommand ! git multi-pack-index write --no-progress <daily.txt &&
+
+ GIT_TRACE2_EVENT="$(pwd)/weekly.txt" \
+ git maintenance run --schedule=weekly 2>/dev/null &&
+ test_subcommand git prune-packed --quiet <weekly.txt &&
+ test_subcommand git commit-graph write --split --reachable \
+ --no-progress <weekly.txt &&
+ test_subcommand git multi-pack-index write --no-progress <weekly.txt
+'
+
+test_expect_success 'maintenance.strategy inheritance' '
+ for task in commit-graph loose-objects incremental-repack
+ do
+ git config --unset maintenance.$task.schedule || return 1
+ done &&
+
+ test_when_finished git config --unset maintenance.strategy &&
+ git config maintenance.strategy incremental &&
+
+ GIT_TRACE2_EVENT="$(pwd)/incremental-hourly.txt" \
+ git maintenance run --schedule=hourly --quiet &&
+ GIT_TRACE2_EVENT="$(pwd)/incremental-daily.txt" \
+ git maintenance run --schedule=daily --quiet &&
+
+ test_subcommand git commit-graph write --split --reachable \
+ --no-progress <incremental-hourly.txt &&
+ test_subcommand ! git prune-packed --quiet <incremental-hourly.txt &&
+ test_subcommand ! git multi-pack-index write --no-progress \
+ <incremental-hourly.txt &&
+
+ test_subcommand git commit-graph write --split --reachable \
+ --no-progress <incremental-daily.txt &&
+ test_subcommand git prune-packed --quiet <incremental-daily.txt &&
+ test_subcommand git multi-pack-index write --no-progress \
+ <incremental-daily.txt &&
+
+ # Modify defaults
+ git config maintenance.commit-graph.schedule daily &&
+ git config maintenance.loose-objects.schedule hourly &&
+ git config maintenance.incremental-repack.enabled false &&
+
+ GIT_TRACE2_EVENT="$(pwd)/modified-hourly.txt" \
+ git maintenance run --schedule=hourly --quiet &&
+ GIT_TRACE2_EVENT="$(pwd)/modified-daily.txt" \
+ git maintenance run --schedule=daily --quiet &&
+
+ test_subcommand ! git commit-graph write --split --reachable \
+ --no-progress <modified-hourly.txt &&
+ test_subcommand git prune-packed --quiet <modified-hourly.txt &&
+ test_subcommand ! git multi-pack-index write --no-progress \
+ <modified-hourly.txt &&
+
+ test_subcommand git commit-graph write --split --reachable \
+ --no-progress <modified-daily.txt &&
+ test_subcommand git prune-packed --quiet <modified-daily.txt &&
+ test_subcommand ! git multi-pack-index write --no-progress \
+ <modified-daily.txt
+'
+
+test_expect_success 'register and unregister' '
+ test_when_finished git config --global --unset-all maintenance.repo &&
+ git config --global --add maintenance.repo /existing1 &&
+ git config --global --add maintenance.repo /existing2 &&
+ git config --global --get-all maintenance.repo >before &&
+
+ git maintenance register &&
+ test_cmp_config false maintenance.auto &&
+ git config --global --get-all maintenance.repo >between &&
+ cp before expect &&
+ pwd >>expect &&
+ test_cmp expect between &&
+
+ git maintenance unregister &&
+ git config --global --get-all maintenance.repo >actual &&
+ test_cmp before actual
+'
+
+test_expect_success 'start from empty cron table' '
+ GIT_TEST_CRONTAB="test-tool crontab cron.txt" git maintenance start &&
+
+ # start registers the repo
+ git config --get --global maintenance.repo "$(pwd)" &&
+
+ grep "for-each-repo --config=maintenance.repo maintenance run --schedule=daily" cron.txt &&
+ grep "for-each-repo --config=maintenance.repo maintenance run --schedule=hourly" cron.txt &&
+ grep "for-each-repo --config=maintenance.repo maintenance run --schedule=weekly" cron.txt
+'
+
+test_expect_success 'stop from existing schedule' '
+ GIT_TEST_CRONTAB="test-tool crontab cron.txt" git maintenance stop &&
+
+ # stop does not unregister the repo
+ git config --get --global maintenance.repo "$(pwd)" &&
+
+ # Operation is idempotent
+ GIT_TEST_CRONTAB="test-tool crontab cron.txt" git maintenance stop &&
+ test_must_be_empty cron.txt
+'
+
+test_expect_success 'start preserves existing schedule' '
+ echo "Important information!" >cron.txt &&
+ GIT_TEST_CRONTAB="test-tool crontab cron.txt" git maintenance start &&
+ grep "Important information!" cron.txt
+'
+
+test_expect_success 'register preserves existing strategy' '
+ git config maintenance.strategy none &&
+ git maintenance register &&
+ test_config maintenance.strategy none &&
+ git config --unset maintenance.strategy &&
+ git maintenance register &&
+ test_config maintenance.strategy incremental
+'
+
test_done
diff --git a/t/t9303-fast-import-compression.sh b/t/t9303-fast-import-compression.sh
index 5045f02..57d9165 100755
--- a/t/t9303-fast-import-compression.sh
+++ b/t/t9303-fast-import-compression.sh
@@ -3,12 +3,6 @@
test_description='compression setting of fast-import utility'
. ./test-lib.sh
-# This should be moved to test-lib.sh together with the
-# copy in t0021 after both topics have graduated to 'master'.
-file_size () {
- test-tool path-utils file-size "$1"
-}
-
import_large () {
(
echo blob
@@ -24,7 +18,7 @@ do
test_when_finished "rm -f .git/objects/pack/pack-*.*" &&
test_when_finished "rm -rf .git/objects/??" &&
import_large -c fastimport.unpacklimit=0 $config &&
- sz=$(file_size .git/objects/pack/pack-*.pack) &&
+ sz=$(test_file_size .git/objects/pack/pack-*.pack) &&
case "$expect" in
small) test "$sz" -le 100000 ;;
large) test "$sz" -ge 100000 ;;
@@ -47,7 +41,7 @@ do
test_when_finished "rm -f .git/objects/pack/pack-*.*" &&
test_when_finished "rm -rf .git/objects/??" &&
import_large -c fastimport.unpacklimit=9 $config &&
- sz=$(file_size .git/objects/??/????*) &&
+ sz=$(test_file_size .git/objects/??/????*) &&
case "$expect" in
small) test "$sz" -le 100000 ;;
large) test "$sz" -ge 100000 ;;
diff --git a/t/t9304-fast-import-marks.sh b/t/t9304-fast-import-marks.sh
new file mode 100755
index 0000000..d4359db
--- /dev/null
+++ b/t/t9304-fast-import-marks.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+test_description='test exotic situations with marks'
+. ./test-lib.sh
+
+test_expect_success 'setup dump of basic history' '
+ test_commit one &&
+ git fast-export --export-marks=marks HEAD >dump
+'
+
+test_expect_success 'setup large marks file' '
+ # normally a marks file would have a lot of useful, unique
+ # marks. But for our purposes, just having a lot of nonsense
+ # ones is fine. Start at 1024 to avoid clashing with marks
+ # legitimately used in our tiny dump.
+ blob=$(git rev-parse HEAD:one.t) &&
+ for i in $(test_seq 1024 16384)
+ do
+ echo ":$i $blob"
+ done >>marks
+'
+
+test_expect_success 'import with large marks file' '
+ git fast-import --import-marks=marks <dump
+'
+
+test_expect_success 'setup dump with submodule' '
+ git submodule add "$PWD" sub &&
+ git commit -m "add submodule" &&
+ git fast-export HEAD >dump
+'
+
+test_expect_success 'setup submodule mapping with large id' '
+ old=$(git rev-parse HEAD:sub) &&
+ new=$(echo $old | sed s/./a/g) &&
+ echo ":12345 $old" >from &&
+ echo ":12345 $new" >to
+'
+
+test_expect_success 'import with submodule mapping' '
+ git init dst &&
+ git -C dst fast-import \
+ --rewrite-submodules-from=sub:../from \
+ --rewrite-submodules-to=sub:../to \
+ <dump &&
+ git -C dst rev-parse HEAD:sub >actual &&
+ echo "$new" >expect &&
+ test_cmp expect actual
+'
+
+test_done
diff --git a/t/t9603-cvsimport-patchsets.sh b/t/t9603-cvsimport-patchsets.sh
index 3e64b11..e7a9161 100755
--- a/t/t9603-cvsimport-patchsets.sh
+++ b/t/t9603-cvsimport-patchsets.sh
@@ -17,23 +17,23 @@ test_description='git cvsimport testing for correct patchset estimation'
setup_cvs_test_repository t9603
test_expect_failure PERL 'import with criss cross times on revisions' '
-
- git cvsimport -p"-x" -C module-git module &&
- (cd module-git &&
- git log --pretty=format:%s > ../actual-master &&
- git log A~2..A --pretty="format:%s %ad" -- > ../actual-A &&
- echo "" >> ../actual-master &&
- echo "" >> ../actual-A
- ) &&
- echo "Rev 4
+ git cvsimport -p"-x" -C module-git module &&
+ (
+ cd module-git &&
+ git log --pretty=format:%s > ../actual-master &&
+ git log A~2..A --pretty="format:%s %ad" -- > ../actual-A &&
+ echo "" >> ../actual-master &&
+ echo "" >> ../actual-A
+ ) &&
+ echo "Rev 4
Rev 3
Rev 2
Rev 1" > expect-master &&
- test_cmp expect-master actual-master &&
+ test_cmp expect-master actual-master &&
- echo "Rev 5 Branch A Wed Mar 11 19:09:10 2009 +0000
+ echo "Rev 5 Branch A Wed Mar 11 19:09:10 2009 +0000
Rev 4 Branch A Wed Mar 11 19:03:52 2009 +0000" > expect-A &&
- test_cmp expect-A actual-A
+ test_cmp expect-A actual-A
'
test_done
diff --git a/t/t9801-git-p4-branch.sh b/t/t9801-git-p4-branch.sh
index 67ff271..a3abd77 100755
--- a/t/t9801-git-p4-branch.sh
+++ b/t/t9801-git-p4-branch.sh
@@ -67,7 +67,7 @@ test_expect_success 'import main, no branch detection' '
(
cd "$git" &&
git log --oneline --graph --decorate --all &&
- git rev-list master >wc &&
+ git rev-list master -- >wc &&
test_line_count = 4 wc
)
'
@@ -78,7 +78,7 @@ test_expect_success 'import branch1, no branch detection' '
(
cd "$git" &&
git log --oneline --graph --decorate --all &&
- git rev-list master >wc &&
+ git rev-list master -- >wc &&
test_line_count = 2 wc
)
'
@@ -89,7 +89,7 @@ test_expect_success 'import branch2, no branch detection' '
(
cd "$git" &&
git log --oneline --graph --decorate --all &&
- git rev-list master >wc &&
+ git rev-list master -- >wc &&
test_line_count = 2 wc
)
'
@@ -100,7 +100,7 @@ test_expect_success 'import depot, no branch detection' '
(
cd "$git" &&
git log --oneline --graph --decorate --all &&
- git rev-list master >wc &&
+ git rev-list master -- >wc &&
test_line_count = 8 wc
)
'
@@ -114,7 +114,7 @@ test_expect_success 'import depot, branch detection' '
git log --oneline --graph --decorate --all &&
# 4 main commits
- git rev-list master >wc &&
+ git rev-list master -- >wc &&
test_line_count = 4 wc &&
# 3 main, 1 integrate, 1 on branch2
@@ -137,7 +137,7 @@ test_expect_success 'import depot, branch detection, branchList branch definitio
git log --oneline --graph --decorate --all &&
# 4 main commits
- git rev-list master >wc &&
+ git rev-list master -- >wc &&
test_line_count = 4 wc &&
# 3 main, 1 integrate, 1 on branch2
diff --git a/t/t9832-unshelve.sh b/t/t9832-unshelve.sh
index 7194fb2..6b3cb04 100755
--- a/t/t9832-unshelve.sh
+++ b/t/t9832-unshelve.sh
@@ -68,7 +68,8 @@ EOF
cd "$git" &&
change=$(last_shelved_change) &&
git p4 unshelve $change &&
- git show refs/remotes/p4-unshelved/$change | grep -q "Further description" &&
+ git show refs/remotes/p4-unshelved/$change >actual &&
+ grep -q "Further description" actual &&
git cherry-pick refs/remotes/p4-unshelved/$change &&
test_path_is_file file2 &&
test_cmp file1 "$cli"/file1 &&
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 7b7bc6e..2be9190 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (c) 2012 Felipe Contreras
+# Copyright (c) 2012-2020 Felipe Contreras
#
test_description='test bash completion'
@@ -1055,13 +1055,13 @@ test_expect_success 'teardown after filtering matching refs' '
git -C otherrepo branch -D matching/branch-in-other
'
-test_expect_success '__git_refs - for-each-ref format specifiers in prefix' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH '__git_refs - for-each-ref format specifiers in prefix' '
cat >expected <<-EOF &&
evil-%%-%42-%(refname)..master
EOF
(
- cur="evil-%%-%42-%(refname)..mas" &&
- __git_refs "" "" "evil-%%-%42-%(refname).." mas >"$actual"
+ cur="evil-%%-%42-%(refname)..mai" &&
+ __git_refs "" "" "evil-%%-%42-%(refname).." mai >"$actual"
) &&
test_cmp expected "$actual"
'
@@ -1360,6 +1360,58 @@ test_expect_success 'git checkout - a later --no-guess overrides previous --gues
EOF
'
+test_expect_success 'git checkout - with checkout.guess = false, only completes refs' '
+ test_config checkout.guess false &&
+ test_completion "git checkout " <<-\EOF
+ HEAD Z
+ master Z
+ matching-branch Z
+ matching-tag Z
+ other/branch-in-other Z
+ other/master-in-other Z
+ EOF
+'
+
+test_expect_success 'git checkout - with checkout.guess = true, completes refs and unique remote branches for DWIM' '
+ test_config checkout.guess true &&
+ test_completion "git checkout " <<-\EOF
+ HEAD Z
+ branch-in-other Z
+ master Z
+ master-in-other Z
+ matching-branch Z
+ matching-tag Z
+ other/branch-in-other Z
+ other/master-in-other Z
+ EOF
+'
+
+test_expect_success 'git checkout - a later --guess overrides previous checkout.guess = false, complete refs and unique remote branches for DWIM' '
+ test_config checkout.guess false &&
+ test_completion "git checkout --guess " <<-\EOF
+ HEAD Z
+ branch-in-other Z
+ master Z
+ master-in-other Z
+ matching-branch Z
+ matching-tag Z
+ other/branch-in-other Z
+ other/master-in-other Z
+ EOF
+'
+
+test_expect_success 'git checkout - a later --no-guess overrides previous checkout.guess = true, complete only refs' '
+ test_config checkout.guess true &&
+ test_completion "git checkout --no-guess " <<-\EOF
+ HEAD Z
+ master Z
+ matching-branch Z
+ matching-tag Z
+ other/branch-in-other Z
+ other/master-in-other Z
+ EOF
+'
+
test_expect_success 'git switch - with --detach, complete all references' '
test_completion "git switch --detach " <<-\EOF
HEAD Z
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 8d59b90..59bbf75 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -783,6 +783,10 @@ test_line_count () {
fi
}
+test_file_size () {
+ test-tool path-utils file-size "$1"
+}
+
# Returns success if a comma separated string of keywords ($1) contains a
# given keyword ($2).
# Examples:
@@ -952,13 +956,7 @@ test_expect_code () {
# - not all diff versions understand "-u"
test_cmp() {
- test $# -eq 2 || BUG "test_cmp requires two arguments"
- if ! eval "$GIT_TEST_CMP" '"$@"'
- then
- test "x$1" = x- || test -e "$1" || BUG "test_cmp '$1' missing"
- test "x$2" = x- || test -e "$2" || BUG "test_cmp '$2' missing"
- return 1
- fi
+ eval "$GIT_TEST_CMP" '"$@"'
}
# Check that the given config key has the expected value.
@@ -987,13 +985,7 @@ test_cmp_config() {
# test_cmp_bin - helper to compare binary files
test_cmp_bin() {
- test $# -eq 2 || BUG "test_cmp_bin requires two arguments"
- if ! cmp "$@"
- then
- test "x$1" = x- || test -e "$1" || BUG "test_cmp_bin '$1' missing"
- test "x$2" = x- || test -e "$2" || BUG "test_cmp_bin '$2' missing"
- return 1
- fi
+ cmp "$@"
}
# Use this instead of test_cmp to compare files that contain expected and
diff --git a/t/test-lib.sh b/t/test-lib.sh
index ef31f40..a863cce 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -499,6 +499,12 @@ then
export GIT_INDEX_VERSION
fi
+if test -n "$GIT_TEST_PERL_FATAL_WARNINGS"
+then
+ GIT_PERL_FATAL_WARNINGS=1
+ export GIT_PERL_FATAL_WARNINGS
+fi
+
# Add libc MALLOC and MALLOC_PERTURB test
# only if we are not executing the test with valgrind
if test -n "$valgrind" ||
@@ -769,15 +775,17 @@ match_pattern_list () {
}
match_test_selector_list () {
+ operation="$1"
+ shift
title="$1"
shift
arg="$1"
shift
test -z "$1" && return 0
- # Both commas and whitespace are accepted as separators.
+ # Commas are accepted as separators.
OLDIFS=$IFS
- IFS=' ,'
+ IFS=','
set -- $1
IFS=$OLDIFS
@@ -805,13 +813,13 @@ match_test_selector_list () {
*-*)
if expr "z${selector%%-*}" : "z[0-9]*[^0-9]" >/dev/null
then
- echo "error: $title: invalid non-numeric in range" \
+ echo "error: $operation: invalid non-numeric in range" \
"start: '$orig_selector'" >&2
exit 1
fi
if expr "z${selector#*-}" : "z[0-9]*[^0-9]" >/dev/null
then
- echo "error: $title: invalid non-numeric in range" \
+ echo "error: $operation: invalid non-numeric in range" \
"end: '$orig_selector'" >&2
exit 1
fi
@@ -819,9 +827,11 @@ match_test_selector_list () {
*)
if expr "z$selector" : "z[0-9]*[^0-9]" >/dev/null
then
- echo "error: $title: invalid non-numeric in test" \
- "selector: '$orig_selector'" >&2
- exit 1
+ case "$title" in *${selector}*)
+ include=$positive
+ ;;
+ esac
+ continue
fi
esac
@@ -1031,7 +1041,7 @@ test_skip () {
skipped_reason="GIT_SKIP_TESTS"
fi
if test -z "$to_skip" && test -n "$run_list" &&
- ! match_test_selector_list '--run' $test_count "$run_list"
+ ! match_test_selector_list '--run' "$1" $test_count "$run_list"
then
to_skip=t
skipped_reason="--run"
@@ -1058,7 +1068,6 @@ test_skip () {
" <skipped message=\"$message\" />"
fi
- say_color skip >&3 "skipping test: $@"
say_color skip "ok $test_count # skip $1 ($skipped_reason)"
: true
;;
@@ -1702,3 +1711,17 @@ test_lazy_prereq SHA1 '
test_lazy_prereq REBASE_P '
test -z "$GIT_TEST_SKIP_REBASE_P"
'
+
+# Special-purpose prereq for transitioning to a new default branch name:
+# Some tests need more than just a mindless (case-preserving) s/master/main/g
+# replacement. The non-trivial adjustments are guarded behind this
+# prerequisite, acting kind of as a feature flag
+test_lazy_prereq PREPARE_FOR_MAIN_BRANCH '
+ test "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" = main
+'
+
+# Ensure that no test accidentally triggers a Git command
+# that runs 'crontab', affecting a user's cron schedule.
+# Tests that verify the cron integration must set this locally
+# to avoid errors.
+GIT_TEST_CRONTAB="exit 1"