mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
enhance: set SuggestedStartLocation
to default clone dir when open local repository (#293)
This commit is contained in:
parent
efa02d9e96
commit
20744d09bd
1 changed files with 6 additions and 0 deletions
|
@ -24,6 +24,12 @@ namespace SourceGit.Views
|
|||
return;
|
||||
|
||||
var options = new FolderPickerOpenOptions() { AllowMultiple = false };
|
||||
if (Directory.Exists(ViewModels.Preference.Instance.GitDefaultCloneDir))
|
||||
{
|
||||
var folder = await topLevel.StorageProvider.TryGetFolderFromPathAsync(ViewModels.Preference.Instance.GitDefaultCloneDir);
|
||||
options.SuggestedStartLocation = folder;
|
||||
}
|
||||
|
||||
var selected = await topLevel.StorageProvider.OpenFolderPickerAsync(options);
|
||||
if (selected.Count == 1)
|
||||
OpenOrInitRepository(selected[0].Path.LocalPath);
|
||||
|
|
Loading…
Reference in a new issue