CodeEdit
CodeEdit copied to clipboard
Fix Source Control File Names With Spaces
Description
Main Changes
- Modifies the GitClient to use
GitChangedFiles orURLs instead ofCEWorkspaceFiles. TheCEWorkspaceFilescreated by these methods were disconnected from the workspace's file manager and it becomes messy to store things like old file names (in the case of renames) and the staged and unstaged statuses. - Updates
GitChangedFileto be able to much more accurately represent a git file change. It now tracks two statuses, provides multiple helper methods and properties for use in UI. - Replaces
GitClient. getChangedFilesandGitClient. getStagedFileswithGitClient. getStatus. Also adds aStatusstruct to theGitClient. This new method uses the porcelain v2 version ofgit statusto fetch more information per file. It also uses the-zoption to get a easily-readable format. - Updates related UI to use
GitChangedFileorURLin place ofCEWorkspaceFIlewhere possible and only fetchCEWorkspaceFiles when necessary.
This also sets up the required changes to view file renames correctly in source control lists.
Other Changes
- Updates
GitClient. getCommitHistoryto correctly specify the branch name and file. Fixes an untracked bug where a file with the same name as a branch would cause an error (eg a file namedmainon themainbranch). - Renames
GitTypetoGitStatus. - Adds a logger to the
GitClientand logs errors in a few key methods. - Fixes a small bug with the workspace document where the URL would not have a trailing
/caused issues when using relative URLs. - Consolidates list view rows for git changes into one View that's reused in a few different lists.
- Updates
GitClient.addandGitClient.resetto use quoted, relative, paths.
Related Issues
- closes #1852
Checklist
- [x] I read and understood the contributing guide as well as the code of conduct
- [x] The issues this PR addresses are related to each other
- [x] My changes generate no new warnings
- [x] My code builds and runs on my machine
- [x] My changes are all related to the related issue above
- [x] I documented my code
Screenshots
Before:
https://github.com/user-attachments/assets/51f59c20-58e3-487b-9c32-7b379e360480
After:
https://github.com/user-attachments/assets/99b5b10d-b18d-4763-9497-1abc12340ad2