Skip to content
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

Can't detect current directory #141

Open
VarunAgw opened this issue Jan 11, 2024 · 3 comments
Open

Can't detect current directory #141

VarunAgw opened this issue Jan 11, 2024 · 3 comments

Comments

@VarunAgw
Copy link

  1. I installed it
  2. Ran cd /D d:\www\wm
  3. Ran git status

I got


fatal: not a git repository (or any parent up to mount point /mnt)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

@VarunAgw VarunAgw changed the title Not working Can't detect current directory Jan 11, 2024
@andy-5
Copy link
Owner

andy-5 commented Jan 15, 2024

Is your drive D: mounted in WSL? Because network drives, removable devices, etc. are not automatically available in WSL.

Does wsl /bin/bash -c 'ls -la /mnt/d/www/wm' work inside Windows CMD/PowerShell? And is there a .git directory in the output?

What is the output of wslpath -au 'D:\www\wm' from within WSL?

If D: is a local hard drive and any of these fails, it would be interesting to know whether you use WSL1 or WSL2 and which Linux distribution is used.

@VarunAgw
Copy link
Author

VarunAgw commented Jan 15, 2024

Hi @andy-5

Thanks for the reply

Does wsl /bin/bash -c 'ls -la /mnt/d/www/wm' work inside Windows CMD/PowerShell? And is there a .git directory in the output?

Yes and yes

$ wslpath -au 'D:\www\wm'
wslpath: D:\www\wm

It's WSL 1 and Ubuntu 22

I should add it's not a local drive but a subst partition. wslgit works fine on C: Drive though

image

$ ls /d -alh
lrwxrwxrwx 1 root root 7 Jan 11 18:14 /d -> /mnt/d/

$ ls /mnt/d -alh
lrwxrwxrwx 1 root root 12 Dec 28 2021 /mnt/d -> /mnt/c/Work/

@andy-5
Copy link
Owner

andy-5 commented Jan 15, 2024

Your output

$ wslpath -au 'D:\www\wm'
wslpath: D:\www\wm

indicates that wslpath does not work. A valid output would be something like /mnt/d/www/wm.

So it seems this is an issue with wslpath, which cannot correctly handle the subst partition.

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

No branches or pull requests

2 participants