This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Create repository for single file #2426
Merged
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.
Please be sure to read the contributor's guide to the GitHub package before submitting any pull requests.
Requirements
Description of the Change
Modify the way that active pane item paths are used to influence the active context paths. Specifically:
Screenshot/Gif
N/A
Alternate Designs
N/A
Benefits
The "repository path" derived from paths within non-git-working-directory project roots will behave more predictably. (This path is used by the "create repository" blank state of the git and GitHub tabs, for example.)
Previously, if you:
/some/root/some/root/subdir/a.txt)The Git tab would previously prompt you to initialize a repo at
/some/root/subdir/a.txt, which doesn't make any sense and would fail. After this change, it would prompt you to initialize at/some/rootinstead.Similarly, if you opened a path
/a/long/path/b.txtthat was outside of any git working directory, you'd be prompted to initialize at/a/long/path/b.txt, but now you'll be prompted to initialize at/a/long/path`.Possible Drawbacks
We don't officially support submodules... but this will likely mess them up further, by preventing you from ever having a submodule as an active path if its parent repo was a project root. I'll investigate how badly it fails before I merge this.
Update: it did indeed break the ability to perform operations within submodules. I've rewritten it to only normalize workdir candidate paths that don't map to git workdirs, which lets us have the best of both worlds.
Applicable Issues
Fixes #2407.
Release Notes