-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Include owner in default path when cloning a repository #1906
Conversation
Expect test to fail until functionality implemented.
Keep the base path consistent if user edits the fully qualified path.
Check different combinations of repository and path changes.
👋 @jcansdale I just had a look at how this works. Question: Feedback:
Both of which are fine as they are since a user will likely select a new local clone path they're happy with if something undesired happened. I think this works really nicely and will be helpful at providing more structure for those who have lots of repositories from different owners or organizations. |
Thanks for taking a 👀
Yup, I always organize my folders in a way that mirrors GitHub. I'll often clone a few repositories from the same owner. It's the only way I can keep any kind of order!
It would be easy enough to reset back to the default clone location if the user removes the full path. I think if someone was to do this, that is what they'd be hoping for?
I'll see if this can be fixed as well without any undesirable consequences. I think its okay for the reason you mentioned, but maybe it could be better. 😄 |
Test that if the target Path is cleared, DefaultClonePath will be used as the base path on next selection.
If Path is cleared, restore the DefaultClonePath on next selection.
Test that we don't duplicate the repo on next selection.
Don't include old the repository name when next repository is selected.
I've fixed the two scenarios that you mentioned and added them to the list. I've also fixed an an edge case where the owner and repository had the same name. Previously it would only delete the repository rather than both. |
This LGTM! ✨ ✨ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one tiny thing, but other than that looks good!
@@ -114,12 +114,10 @@ public async Task Path_Is_Initialized() | |||
public async Task Repository_Name_Is_Appended_To_Base_Path() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to update test name.
We're now adding the owner and repository name to the path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What this PR does
Rather than suggesting a flat folder structure when cloning a repository, suggest a folder structure that includes the repositories owner
DefaultClonePath/Owner/RepoName
DefaultClonePath
portion of path (keep when new repo is selected)How to test
Immediately change default clone path
DefaultClonePath
before selecting a repositoryowner\repo
has been added to pathChange directory name after selecting repository
owner\repo
in path has changedRemove repository name from path
repo
has been added to pathRemove owner and repository name from path
owner\repo
has been added to pathClear the path
owner\repo
added to pathRemove owner from path