Uh oh!
There was an error while loading. Please reload this page.
Allow cloning of repositories into empty directories - #2316
Conversation
- Currently clone button is disabled and open button is enabled on empty directories. - Desired behavior should support cloning to empty directories. - Non-empty directory message is not shown when the directory is empty.
jcansdale
left a comment
There was a problem hiding this comment.
This is looking good!
Could you add some unit tests? Something similar to this...
https://github.com/github/VisualStudio/blob/master/test/GitHub.App.UnitTests/ViewModels/Dialog/Clone/RepositoryCloneViewModelTests.cs#L317
Maybe add the following tests:
Clone_Is_Enabled_When_Path_EmptyDirectoryExists
PathWarning_Is_Not_Set_When_EmptyDirectoryExists_Selected
I've just realized this is a draft PR. Sorry if I've jumped the gun reviewing it. ;-)
Uh oh!
There was an error while loading. Please reload this page.
80198b4 to
43b5ef6Compare
jcansdale
left a comment
There was a problem hiding this comment.
The code for this looks good! 😄 We just need someone to confirm the functionality.
Thanks for the PR!
StanleyGoldman
left a comment
There was a problem hiding this comment.
We probably need to make the error/warning messages clearer...
For instance when I'm trying to clone into a directory that is not empty and does not have a git repo
The message says "There is already a repository at this location, but it does not contain a repository".
That's not entirely accurate, I haven't looked but I think we have to re-evaluate the messages output by the view model in this and probably some other cases.
StanleyGoldman
commented
Apr 5, 2019
StanleyGoldman
commented
Apr 5, 2019
The more I look at it, it's just that one message that would no longer be accurate... If the directory is not empty, and is not a git repo that could be scanned. Based on the current logic in this Pull Request. |
StanleyGoldman
commented
Apr 5, 2019
Let @meaghanlewis weigh in before you change anything... |
meaghanlewis
commented
Apr 5, 2019
I agree with what @StanleyGoldman proposed: |
YuPeiHenry
commented
Apr 7, 2019
@StanleyGoldman I have updated the error message for |
a29268a to
ef0ed57CompareHey @YuPeiHenry I pushed some commits. It felt easier than nit picking at you. 😈 So I copied the English text to all the language files, we have a 3rd party resource that translates things for us. So we just put the English in place until they get around to it. I also realized I reordered the logic funny in my pseudocode. You changed the flow to match my ramblings. I undid the damage I caused. Sorry to put you through my spaghetti brain. And I tweaked All nit picks. I didn't wanna bug you with it. 😅 Since my hands have been all in this, I'm going to let @meaghanlewis test this and give us both the final approval. |
meaghanlewis
commented
Apr 8, 2019
thank you @YuPeiHenry for your contribution! 🎉 |


Ready for review
fixes#2250
The fix modifies
CanCloneandCanOpenonRepositoryCloneViewModel, and modifiedRepositoryCloneServiceCloneOrOpenRepository method to factor for empty directories.