fix(desktop): workspace git actions enhancement#3988
Conversation
2483135 to
f2a15c5
Compare
SivanCola
left a comment
There was a problem hiding this comment.
Thanks for the update here. I found two workspace-scoping issues that should be fixed before this lands:
-
WorkspaceGitCommitcurrently runsgit commit -mwithout a pathspec. If the user opens a repository subdirectory as the workspace, the UI only shows staged files inside that subdirectory, but Git still commits the entire repository index. I reproduced this withgit -C sub commit, which committed bothsub/a.txtand an already-stagedother/b.txt. Please scope the commit to the active workspace, for example with-- .or an explicit repo-root-relative workspace pathspec. -
WorkspaceGitStageAllandWorkspaceGitUnstageAllhave the same subdirectory leak:git -C sub add -Aandgit -C sub reset HEAD --affect changes outsidesub/. These bulk actions should also use the same workspace-scoped pathspec, including the unborn-HEAD fallback path.
The Go tests passed locally, and the frontend build passed after regenerating the ignored Wails bindings. A regression test that opens/uses a repo subdirectory would be a good guard for both cases.
`WorkspaceGitCommit`, `WorkspaceGitStageAll`, and `WorkspaceGitUnstageAll` previously ran without a pathspec, leaking changes outside the workspace when the workspace is a repository subdirectory. Scope all three to `-- .` (including the unborn-HEAD rm fallback) so only workspace-relative files are affected.
f2a15c5 to
cfb8023
Compare
|
Fixes an issue where Git batch operations "leaked" outside the workspace when the workspace was set to a repository subdirectory. IssueWhen a user opens a repository subdirectory (e.g.,
FixAdded the TestingAdded |
The previous PR was closed due to the handling of the branch; a new PR is now being submitted. A fallback mechanism has been implemented for the Git "unstage" operation, and code related to a horizontal scrolling overflow issue—which did not require a fix—has been removed.
#3822