gitbutler icon indicating copy to clipboard operation
gitbutler copied to clipboard

Dragging changed files from a commit to the workspace gives an error

Open daniilS opened this issue 1 year ago • 3 comments
trafficstars

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.

image

How to reproduce

No response

Expected behavior

No response

Relevant log output

No response

daniilS avatar Jul 10 '24 10:07 daniilS

Thanks for reporting! Dragging has been in the works recently, and I wonder if this is related.

Byron avatar Jul 10 '24 12:07 Byron

Yep, having the same error. It doesn't appear to be related to the UI.

image

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

PavelLaptev avatar Jul 12 '24 09:07 PavelLaptev

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.

eproxus avatar Sep 05 '24 06:09 eproxus