Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
andrew-rosca opened this issue Sep 22, 2024 · 3 comments
Open
Assignees
Labels
bug Something isn't working 🦀gitoxide🦀 `gitoxide` might help here os:windows The Windows platform

Comments

@andrew-rosca
Copy link

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

  • clone a repository in a directory accessible over the network; in my case, this is a directory in my local Linux VM hosted on WSL2
  • map a Windows drive to the network directory (e.g. U:)
  • attempt to add the repo to GitButler by browsing to the mapped drive and the respective directory

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
Copy link
Collaborator

Byron commented Sep 22, 2024

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 GitoxideLabs/gitoxide#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.

@Byron Byron added the feedback requested Feedback was requested to help resolve the issue label Sep 22, 2024
@Byron Byron self-assigned this Sep 22, 2024
@andrew-rosca
Copy link
Author

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 Byron removed the feedback requested Feedback was requested to help resolve the issue label Sep 23, 2024
@Byron
Copy link
Collaborator

Byron commented Sep 23, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🦀gitoxide🦀 `gitoxide` might help here os:windows The Windows platform
Projects
None yet
Development

No branches or pull requests

2 participants