Skip to content

Conversation

@genshen
Copy link
Owner

@genshen genshen commented Jan 8, 2026

see also bug report on go-git: go-git/go-git#771

in go-git v6, it provide the option to config and set filemode
(see: go-git/go-git#1712)
The filemode can fix the bug of "worktree contains unstaged changes" on windows.
…tree contains unstaged changes`

On Windows system, when running `pkg fetch` a git package, it may exit with an error `worktree
contains unstaged changes`. This happens when checkout to a specific git tag or branch or commit
hash if the repo contains executable file. On Windows, go-git clone will remove the executable
permission, and make the executable files to be marked as modified when running `git status`,
which causes go-git checkout failes with an error `worktree contains unstaged changes`.

This commit fixed the bug by setting `core.filemode` as false on Windows.

see also: go-git/go-git#771
@genshen genshen merged commit 9f05a52 into master Jan 8, 2026
2 checks passed
@genshen genshen deleted the fix-fetch-error-unstaged-changes branch January 8, 2026 13:19
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