jesseduffield / jesseduffield/lazygit
An error occurred! -- Detected dubious ownership in repository
- Dominant language
- Go
- Stars
- 82.4k
- Forks
- 3k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 19
Description
## `lazygit --logs`
```
Feb 3 23:33:42 |INFO| starting main loop
Feb 3 23:33:42 |INFO| Updating is currently not supported for windows until we can fix permission issues
Feb 3 23:33:42 |DEBU| RunCommand command="git rev-parse --is-bare-repository"
Feb 3 23:33:42 |DEBU| RunCommand command="git fetch --all"
Feb 3 23:33:42 |INFO| git fetch --all (45.6645ms)
Feb 3 23:33:42 |ERRO| fatal: detected dubious ownership in repository at 'F:/...'
'F:/...' is owned by:
'S-1-5-32-544'
but the current user is:
'S-1-5-21-802389545-1753003416-3268149312-1001'
To add an exception for this directory, call:
git config --global --add safe.directory F:/...
command="git rev-parse --is-bare-repository"
Feb 3 23:33:42 |INFO| git rev-parse --is-bare-repository (47.4159ms)
Feb 3 23:33:42 |INFO| refreshing the following scopes in async mode: branches,commits,remotes,tags
Feb 3 23:33:42 |INFO| Refresh took 0s
Feb 3 23:33:42 |ERRO| *errors.errorString fatal: detected dubious ownership in repository at 'F:/...'
'F:/...' is owned by:
'S-1-5-32-544'
but the current user is:
'S-1-5-21-802389545-1753003416-3268149312-1001'
To add an exception for this directory, call:
git config --global --add safe.directory F:/...
/home/runner/work/lazygit/lazygit/pkg/commands/oscommands/cmd_obj_runner.go:200 (0x852b5b)
/home/runner/work/lazygit/lazygit/pkg/commands/oscommands/cmd_obj_runner.go:107 (0x851bac)
/home/runner/work/lazygit/lazygit/pkg/commands/oscommands/cmd_obj_runner.go:71 (0x85152f)
/home/runner/work/lazygit/lazygit/pkg/commands/oscommands/cmd_obj.go:194 (0x85044f)
/home/runner/work/lazygit/lazygit/pkg/commands/git_commands/status.go:62 (0x88385a)
/home/runner/work/lazygit/lazygit/pkg/commands/git_commands/status.go:56 (0x9d64f6)
/home/runner/work/lazygit/lazygit/pkg/gui/recent_repos_panel.go:11 (0x9d64de)
/home/runner/work/lazygit/lazygit/pkg/gui/gui.go:803 (0x9cd265)
/home/runner/work/lazygit/lazygit/pkg/gui/layout.go:196 (0x9d43d1)
/home/runner/work/lazygit/lazygit/pkg/gui/layout.go:124 (0x9d3f37)
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:697 (0x631fff)
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:1139 (0x633ec4)
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:766 (0x6326c5)
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:739 (0x632345)
/home/runner/work/lazygit/lazygit/pkg/gui/gui.go:669 (0x9cbd85)
/home/runner/work/lazygit/lazygit/pkg/gui/gui.go:675 (0x9cc2ac)
/home/runner/work/lazygit/lazygit/pkg/utils/utils.go:108 (0x6fe7e7)
/home/runner/work/lazygit/lazygit/pkg/gui/gui.go:674 (0x9cc1f4)
/home/runner/work/lazygit/lazygit/pkg/app/app.go:263 (0x9fa929)
/home/runner/work/lazygit/lazygit/pkg/app/app.go:48 (0x9fa8be)
/home/runner/work/lazygit/lazygit/pkg/app/entry_point.go:150 (0x9fcb66)
/home/runner/work/lazygit/lazygit/main.go:23 (0x9fe3fe)
/opt/hostedtoolcache/go/1.20.7/x64/src/runtime/internal/atomic/types.go:194 (0x30a2d7)
/opt/hostedtoolcache/go/1.20.7/x64/src/runtime/asm_amd64.s:1598 (0x3372e1)
```
## Steps to reproduce the behavior
I have machine with both Debian 12 and Windows installed, and I switch them periodically.
- Create/clone a repo on Linux;
- Boot Windows;
- `cd` to the repo, run `lazygit`.
The same error occurs in reverse too (when the repo is created on Windows but lazygit is opened on Linux).
## Expected behavior
Lazygit does not error, a prompt asking to add this repository to the list of safe repositories (run `git config --global --add safe.directory <...>`) is shown.
## Version info
On Windows:
```powershell
PS F:\...> lazygit -v
commit=5e388e21c8ca6aa883dbcbe45c47f6fdd5116815, build date=2023-08-07T14:05:48Z, build source=binaryRelease, version=0.40.2, os=windows, arch=amd64, git version=2.39.2.windows.1
PS F:\...> git -v
git version 2.39.2.windows.1
```
## Additional context
[git-config.txt-safedirectory](https://git-scm.com/docs/git-config/2.35.2#Documentation/git-config.txt-safedirectory)
Contributor guide
Assessment
This issue has not been assessed yet.