gitbutler
gitbutler copied to clipboard
Dragging changed files from a commit to the workspace gives an error
Version
0.5.596
Operating System
Windows
Distribution Method
msi (Windows)
Describe the issue
When you drag a file from a commit, you can drag it to the workspace of other virtual branches (but not to to the workspace on the current branch, surprisingly). However, doing that gives the following error:
Failed to update hunk ownership
Invalid args branch for command update_virtual_branch: ownership ranges cannot be empty
Either dragging a committed file to a workspace should uncommit the changes, or it shouldn't be possible to drag the file there.
In addition, dragging a file onto the commit it originally came from gives a Failed to amend commit no rebase was performed error, when it should probably do nothing at all.
How to reproduce
No response
Expected behavior
No response
Relevant log output
No response
Thanks for reporting! Dragging has been in the works recently, and I wonder if this is related.
Yep, having the same error. It doesn't appear to be related to the UI.
https://github.com/user-attachments/assets/f965c782-a73f-41dc-9eaa-951eb075812d
Additionally, I've noticed that if I drag the file from a commit, the commit shows the Amend commit state. This shouldn't happen because we can't amend a file in the same commit.
https://github.com/user-attachments/assets/020513d4-97bc-493e-ab72-0d2b3cd4bfb0
Probably @Caleb-T-Owens could help here
This also happens if one drags a changed file into a previously committed commit. Strangely enough if one drags it several times it finally works without the error and the file gets amended into the commit.