Skip to content

t9005-workspace-commit-push: setup pushes to main on a master repo #195

Description

@mizchi

Corrected. The original version listed two failures. Test 3 was an artifact of the environment I triaged in and is retracted below; the setup failure is genuine.

Summary

t/t9005-workspace-commit-push.sh fails 1 of 7 where init.defaultBranch is unset and git defaults to master.

not ok 1 - setup: create upstream bare repository and working clone
# passed: 6   failed: 1

The failing assertion

	mkdir upstream.git &&
	(cd upstream.git && git init --bare) &&
	git clone upstream.git work &&
	(cd work &&
	 git config user.email "test@example.com" &&
	 git config user.name "Test User" &&
	 echo "v1" > app.txt &&
	 git add app.txt &&
	 git commit -m "initial" &&
	 git push origin main)

The clone's branch is master, so git push origin main fails and the setup step reports failure.

Suggested fix

Pin the branch at git init — -b main, or git symbolic-ref HEAD refs/heads/main for git older than 2.28.

Same class as #191 (fixed in #192), #193 and #194.

Retraction: test 3

I originally flagged not ok 3 - implicit commit creates workspace commit with transaction trailer alongside this, and speculated it might be a second defect in implicit translation.

It is not. It was the same environment artifact described in #194: the container exports GIT_CONFIG_*, which makes should_delegate_to_real_git (modules/bit/cmd/bit/main.mbt:1044) hand the command to the real git binary before workspace_translate_implicit_command can run. With those variables unset only the setup failure above remains.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions