You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/integration/targets/git/tasks
Sviatoslav Sydorenko c0e0550bce
🐛 Make integration tests compatible w/ modern Git (#80122)
* 🐛 Make integration tests compatible w/ modern Git

This patch makes use of the `init.defaultBranch` setting to unify
the test across new and old Git versions since one defaults to
`master` and the other uses `main` for the default branch.

Where possible, it uses the `HEAD` committish to avoid having to
normalize the branch name.

The change fixes the following integration tests:

  * `ansible-galaxy`

  * `ansible-galaxy-collection-scm` (recursive collection)

  * `git`

* 🐛Replace `git-symbolic-ref` with a repo template

This custom Git repository template emulates the `init.defaultBranch` setting
on Git versions below 2.28. Ref: https://superuser.com/a/1559582.
Other workarounds mentioned there, like invoking
`git symbolic-ref HEAD refs/heads/main` after each `git init` turned
out to have mysterious side effects that break the tests in surprising ways.

* 🎨 Make Git integration test non-destructive

This patch makes use of the `$HOME` environment variable to trick Git
into using a user-global config generated in the temporary directory.
2 years ago
..
ambiguous-ref.yml Correct usage for shutil.rmtree (#31541) 7 years ago
archive.yml Remove COMMAND_WARNINGS and warn (#77411) 3 years ago
change-repo-url.yml Deprecate tests used as filters (#32361) 7 years ago
checkout-new-tag.yml Deprecate tests used as filters (#32361) 7 years ago
depth.yml 🐛 Make integration tests compatible w/ modern Git (#80122) 2 years ago
forcefully-fetch-tag.yml 🐛 Make integration tests compatible w/ modern Git (#80122) 2 years ago
formats.yml Correct usage for shutil.rmtree (#31541) 7 years ago
gpg-verification.yml 🐛 Make integration tests compatible w/ modern Git (#80122) 2 years ago
localmods.yml 🐛 Make integration tests compatible w/ modern Git (#80122) 2 years ago
main.yml 🐛 Make integration tests compatible w/ modern Git (#80122) 2 years ago
missing_hostkey.yml 🐛 Make integration tests compatible w/ modern Git (#80122) 2 years ago
missing_hostkey_acceptnew.yml 🐛 Make integration tests compatible w/ modern Git (#80122) 2 years ago
no-destination.yml Deprecate tests used as filters (#32361) 7 years ago
reset-origin.yml 🐛 Make integration tests compatible w/ modern Git (#80122) 2 years ago
separate-git-dir.yml Support `--separate-git-dir` option in Git module (#41712) 6 years ago
setup-local-repos.yml 🐛 Make integration tests compatible w/ modern Git (#80122) 2 years ago
setup.yml 🐛 Make integration tests compatible w/ modern Git (#80122) 2 years ago
single-branch.yml 🐛 Make integration tests compatible w/ modern Git (#80122) 2 years ago
specific-revision.yml 🐛 Make integration tests compatible w/ modern Git (#80122) 2 years ago
submodules.yml Fix git submodules path issue (#75655) 3 years ago