Skip to content

Conversation

@whitequark
Copy link

No description provided.

@whitequark whitequark changed the base branch from main to v6-exp November 6, 2025 09:02
@whitequark whitequark changed the base branch from v6-exp to main November 6, 2025 09:02
@whitequark
Copy link
Author

Fixed commit message.

@pjbgf
Copy link
Member

pjbgf commented Nov 6, 2025

@whitequark thanks for proposing this PR. Please add a test (or perhaps a simple wasip1 step/workflow) to ensure that this works and future changes won't break it?

@whitequark
Copy link
Author

Please add a test (or perhaps a simple wasip1 step/workflow) to ensure that this works and future changes won't break it?

I've considered it but I could not find a place where e.g. GOOS=js would be tested, or other existing OSes. Did I miss it?

@pjbgf
Copy link
Member

pjbgf commented Nov 6, 2025

@whitequark Let's create a new GH workflow just for this, that installs wasmtime and run a simple test that confirm some basic workflow for wasm. For example:

$ curl https://wasmtime.dev/install.sh -sSf | bash
$ GOOS=wasip1 GOARCH=wasm go test -c -o go-git.wasm github.com/go-git/go-git/v6
$ wasmtime run go-git.wasm -test.v -test.run '^TestWasmInit$' github.com/go-git/go-git/v6
=== RUN   TestWasmInit
--- PASS: TestWasmInit (0.00s)
PASS

The test could be something as simple as:

func TestWasmInit(t *testing.T) {
	st := memory.NewStorage()
	wt := memfs.New()

	r, err := Init(st, WithWorkTree(wt))
	require.NoError(t, err)
	assert.NotNil(t, r)

	h := createCommit(t, r)
	assert.False(t, h.IsZero())

	ref, err := r.Head()
	require.NoError(t, err)
	require.NotNil(t, ref)
	assert.False(t, ref.Hash().IsZero())
	assert.Equal(t, h, ref.Hash())
}

But feel free to expand on it.

Also, please note that this PR also needs an additional change:

func preReceiveHook(_ string) []byte {
	return []byte{}
}

}
}

func isSymlinkWindowsNonAdmin(err error) bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func isSymlinkWindowsNonAdmin(err error) bool {
func isSymlinkWindowsNonAdmin(_ error) bool {

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants