diff --git a/.gitignore b/.gitignore index 9a81b694..4b9b03bd 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,9 @@ t/shim.log t/t0022-shim-random.sh t/tmptrace/ t/trace +# t/test-lib.sh keeps the trash directory when a test fails, so these linger +# after every red run. +t/trash-directory.* tmp/ goodbye.ts version.ts diff --git a/fixtures/workspace_flow/bootstrap.sh b/fixtures/workspace_flow/bootstrap.sh index 06e1804a..d1b1dadc 100755 --- a/fixtures/workspace_flow/bootstrap.sh +++ b/fixtures/workspace_flow/bootstrap.sh @@ -21,6 +21,11 @@ init_repo() { ( cd "$repo_dir" git init -q + # Pin the branch rather than inheriting the host's default. Tests built + # on this fixture name `main`, and git still defaults to `master` where + # init.defaultBranch is unset. Setting HEAD while it is unborn works on + # every git version, unlike `git init -b`. + git symbolic-ref HEAD refs/heads/main git config user.email "fixture@example.com" git config user.name "Fixture User" printf "%s\n" "$file_content" > "$file_name"