Re-encode cwd if path does not exist#1214
Conversation
Fixes the case where a folder name is cloned with url-encoded spaces
fcollonval
left a comment
There was a problem hiding this comment.
I don't understand how this can fix the issue. Would you mind providing more explanation?
|
If I have a folder with the literal name: jupyterlab-git does not recognize that any git repository exists in this folder (it shows the "You are not currently in a Git repository" page). This folder is encoded into the Jupyter URL as: I believe the problem is that this URL is somehow getting decoded twice (or more) by the time it reaches the The desired value after exactly 1 decode: The actual value (2 or more decodes happening): Since the folder I'm unable to identify where/how exactly the URL is getting decoded twice, to fix the root cause. So for this PR I suggest checking if the path exists: And if this path does not exist, try again but with the spaces encoded: This fix will correctly identify that there is a git repository inside a folder literally named: Hope that clarifies the problem and the fix. |
|
Thanks for the additional explanation @ardislu So it means that with this PR if the repository is named |
|
And if you use the |
Correct.
Full end to end example:
Gives me a folder literally named |
|
Thanks a lot for the reply. My fear with the current fix is that it may escape unwanted space. For example if your repository is located at |

Fixes the case where a folder name is cloned with url-encoded spaces.
Closes #1211