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

Branch name conflicts with existing directory name #1318

Open
Paul2708 opened this issue Feb 28, 2024 · 1 comment
Open

Branch name conflicts with existing directory name #1318

Paul2708 opened this issue Feb 28, 2024 · 1 comment
Labels

Comments

@Paul2708
Copy link

Description

If there exists a directory with the same name as a branch, switching to this branch fails.
The following error message is shown:

image

Failed to switch branch: fatal: ambiguous argument 'b': both revision and filename Use '--' to separate paths from revisions, like this: 'git [...] -- [...]'

Reproduce

  1. Initialize a new repository and create an initial commit (e.g., creating a README file).
  2. Create a new branch "test". Now, switching branches works as expected.
  3. Switch into branch "main" and create a new directory called "test".
  4. Now, switching back to the branch "test" results in the error above.

Expected behavior

Due to the error, the branch could not be switched.
Thus, the expected behavior is that switching branches works even if there is a directory with the same name.

Context

  • Python package version: 0.50.0
  • Extension version: @jupyterlab/git v0.50.0 enabled OK (python, jupyterlab-git)
  • Git version: 2.42.0
  • Operating System and its version: Ubuntu 20.04 (WSL)
Command Line Output
[D 2024-02-28 20:40:06.211 ServerApp.jupyterlab_git] Execute ['git', 'diff', 'main', 'test', '--name-only', '-z'] in /home/paul/cammp/del-me-git-extension-test/myrepo.
[D 2024-02-28 20:40:06.216 ServerApp.jupyterlab_git] Code: 128
    Output:
    Error: fatal: ambiguous argument 'test': both revision and filename
    Use '--' to separate paths from revisions, like this:
    'git  [...] -- [...]'

[E 2024-02-28 20:40:06.217 ServerApp] {
"Host": "localhost:8888",
"Accept": "/",
"Referer": "http://localhost:8888/lab/tree/myrepo/Untitled.ipynb",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 OPR/107.0.0.0"
}
[E 2024-02-28 20:40:06.217 ServerApp] 500 POST /git/myrepo/changed_files?1709149206166 (7db4901c31a141f884dfee37ae6f7412@127.0.0.1) 48.59ms referer=http://localhost:8888/lab/tree/myrepo/Untitled.ipynb

@Paul2708 Paul2708 added the bug label Feb 28, 2024
Copy link

welcome bot commented Feb 28, 2024

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant