-
Notifications
You must be signed in to change notification settings - Fork 874
Open
Labels
bugSomething isn't workingSomething isn't working🦀gitoxide🦀`gitoxide` might help here`gitoxide` might help here
Description
Version
0.19.5
Operating System
macOS
Distribution Method
dmg (Mac OS - Apple Silicon)
Describe the issue
If there is already a branch with name x and you try to create a branch with name x/y with but branch new x/y, it outputs the following error and the branch creation fails:
❯ but branch new x
✓ Created branch x
❯ but branch new x/y
Error: The ref file "/Users/nomura/tmp/gb-fs-in-branch/.git/refs/heads/x/y" could not be read in full
Caused by:
Not a directory (os error 20)I see the same error when creating the branch x/y from GitButler UI.
Note that the branch creation is successful if branch x does not exist:
# Branch `xx` does not exist so it succeeds
❯ but branch new xx/yy
✓ Created branch xx/yyIf you run but teardown and try to create branch x/y with git, it also fails:
❯ git switch -c x/y
fatal: cannot lock ref 'refs/heads/x/y': 'refs/heads/x' exists; cannot create 'refs/heads/x/y'
If you don't create branch x via GitButler, you can create branch x/y:
❯ git init
Initialized empty Git repository in /Users/nomura/tmp/gb-fs-in-branch-git/.git/
❯ git switch -c b
Switched to a new branch 'b'
❯ git switch -c b/a
Switched to a new branch 'b/a'(Git version 2.53.0)
So I suspect the way GitButler create a branch whose name contains a forward slash / is different from Git, and that causes this difference in behavior.
A similar issue can be found here:
How to reproduce (Optional)
No response
Expected behavior (Optional)
No response
Relevant log output (Optional)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working🦀gitoxide🦀`gitoxide` might help here`gitoxide` might help here