gitbutlerapp / gitbutler

The GitButler version control client, backed by Git, powered by Tauri/Rust/Svelte
https://gitbutler.com
Other
12.6k stars 498 forks source link

Error when adding a local repo from a mapped network drive on Windows #4954

Open andrew-rosca opened 1 week ago

andrew-rosca commented 1 week ago

Version

0.12.25

Operating System

Windows

Distribution Method

msi (Windows)

Describe the issue

An error occurs when attempting to add a local repo from a mapped network drive on Windows.

The error message is misleading, because there is an actual error in the logs, but the error displayed to the user is "Must be a Git repository" (which the directory actually is)

How to reproduce

Expected behavior

Repo is added successfully

Relevant log output

2024-09-22T16:57:57.029516Z  INFO add_project: crates\gitbutler-tauri\src\projects.rs:23: new path="U:\\home\\prj\\butler-repo"
2024-09-22T16:57:57.050538Z ERROR add_project: crates\gitbutler-tauri\src\projects.rs:23: error=Error(must be a Git repository

Caused by:
    Couldn't get security information for path 'U:\home\prj\butler-repo\.git' with err Incorrect function. (os error 1)) path="U:\\home\\prj\\butler-repo"
2024-09-22T16:57:57.050642Z  INFO add_project: crates\gitbutler-tauri\src\projects.rs:23: close time.busy=21.1ms time.idle=32.8µs path="U:\\home\\prj\\butler-repo"
Byron commented 1 week ago

Thanks so much for reporting!

It appears that gitoxide was unable to obtain ownership information from a mapped network drive. Maybe git2 would succeed here, but gix seems to be first in line. It seemingly does things similarly. Git itself also seems to do the same, so I wonder if git works in the mapped location?

Maybe this is at least tangentially related to https://github.com/Byron/gitoxide/pull/1429, and I'd hope that @EliahKagan could also take a look. Seeing how similar the implementations are I wonder if Git for Windows patches in something special there.

andrew-rosca commented 1 week ago

Yes, git appears to work on the mapped drive from Windows.

PS U:\home\prj\butler-repo> git version
git version 2.45.2.windows.1

PS U:\home\prj\butler-repo> git status
Refresh index: 100% (10273/10273), done.
On branch main
Your branch is up to date with 'origin/main'.
...
Byron commented 1 week ago

Thank you, this gives me hope it can be fixed, with the 'how' being publicly available at least in the Git for Windows repository.