Repository navigation
Fix stray <timestamp> tab when committing from untitled workspace - #362
Merged
Merged
Conversation
When the open workspace is an unsaved multi-root workspace, `workspace.workspaceFile` is set to `untitled:<timestamp>`. Interpolating that into `GIT_EDITOR` caused `code --reuse-window` to receive it as a relative file path and open a stray empty tab alongside `COMMIT_EDITMSG` on every commit. Lets only pass `workspaceFile.fsPath` when its scheme is `file`. For untitled workspaces, omit the path argument entirely — passing a folder path instead would regress kahole#316 by prompting to save the untitled workspace. Fixes kahole#346.
Contributor
Author
|
FTR I've tested this locally. |
Collaborator
|
I haven't tested this locally, but it looks sensible. Thanks for the PR! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I kept hitting into the issue reported in #346 and I think this MR fixes it.
When the open workspace is an unsaved multi-root workspace,
workspace.workspaceFileis a URI withuntitled:scheme whosefsPathis a bareDate.now()string (e.g.1774006721975). Interpolating that intoGIT_EDITORcausedcode --reuse-windowto receive it as a relative file path and open a stray empty tab alongsideCOMMIT_EDITMSGon every commit.With the changes in the PR it we only pass
workspaceFile.fsPathwhen its scheme isfile. For untitled workspaces, omit the path argument entirely passing a folder path instead would regress #316 by prompting to save the untitled workspace.