"The repository for X:\ is not open in Atom." Git Unstaged Changes Tab Error
Closed this issue · 6 comments
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Reproduced the problem in Safe Mode: http://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: http://flight-manual.atom.io/hacking-atom/sections/debugging/
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description
Clicking to view unstaged changes in the git panel just opens a blank window with the error "This repository for D:\ is not open in Atom", this happens for every project I've tried it on.
Steps to Reproduce
- Open project in Atom
- Expand git panel, click on unstaged change
- The "Unstaged Changes" tab only says "The repository for D:\ is not open in Atom.", or with C:\ instead of D:.
Expected behavior: Show file changes. This used to work but recently broke.
Reproduces how often: 100%
Versions
Atom : 1.20.0
Electron: 1.6.9
Chrome : 56.0.2924.87
Node : 7.4.0
apm 1.18.4
npm 3.10.10
node 6.9.5 x64
python 3.6.0
git 2.12.1.windows.1
visual studio
Microsoft Windows [Version 10.0.15063]
Additional Information
Atom correctly knows which files have been changed and it shows the right colours for changed/removed/new lines too.
Hm, interesting. @RankWinner, when you reproduce this, can you please open the dev tools (you can use the "Window: Toggle Dev Tools" command, and once they show, click on the "Console" tab and run the following:
atom.packages.getActivePackage('github').mainModule.controller.props.repository.getWorkingDirectoryPath()
and also
atom.project.getPaths()
and let us know what the output is?
Sure:
atom.packages.getActivePackage('github').mainModule.controller.props.repository.getWorkingDirectoryPath()
null
and
atom.project.getPaths()
["D:\#Cloud and Storage\Google Drive\##Documents##\Projects\VADAnalysis"]
I messed around a bit and made a new folder in an empty folder in a more... conventional location without all my random special characters, used the Create repository
option from the Git tab in Atom on that new folder, saved a random file in it and everything worked fine, with both commands outputting the same path.
Trying to initialize a 'new' project over my existing one (which doesn't currently work) through Atom gives this error:
Unable to initialize git repository in D:#Cloud and StorageGoogle Drive##Documents##Projects\VADAnalysis This directory already contains a git repository
However doing the same over the repo I made to test this produces the error:
Unable to initialize git repository in D:\GitTest This directory already contains a git repository
Since that worked I tried initializing a repo in a folder starting with # twice, which gave the error:
Unable to initialize git repository in D:#HashTest\GitTest This directory already contains a git repository
So my best guess is that some update made it so that \#
isn't properly escaped anymore? Weirdly enough Atom won't even let me open the folder D:\#HashTest\GitTest
via the File -> Open Folder option, I managed to 'open' it by creating a file there. Checking the Git tab again shows the error "The repository for D:\ is not open in Atom".
Running the commands again gives:
atom.packages.getActivePackage('github').mainModule.controller.props.repository.getWorkingDirectoryPath()
null
atom.project.getPaths()
["D:\GitTestD", "D:\#HashTest\GitTest"]
So it probably is something related to me using # in my folder names.
My folder name does not contains # , and it had same problem.
I'm having the same issue on OSX.
atom.appVersion
'1.20.0'
atom.packages.getActivePackage('github').mainModule.controller.props.repository.getWorkingDirectoryPath()
"/Users/username/dev/Project%20MVP"
atom.project.getPaths()
['/Users/username/dev/Project%20MVP']
(NOTE: i changed the username and project name, but there isn't any special characters there so i doubt that would change anything)
I believe that this issue is due to the same bug: #1177
But on Linux the error message is "File has no contents" instead of the Windows error of the repository not being open.
So the cause may be having spaces of any special characters in the file name or path, if it is the same bug, can't check right now since I'm away from my computer though.
I have the same issue when using the '+' character in the file path, but not with the '!' character (I sometimes use these to sort my folders).