mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -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;
|
return;
|
||||||
|
|
||||||
var options = new FolderPickerOpenOptions() { AllowMultiple = false };
|
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);
|
var selected = await topLevel.StorageProvider.OpenFolderPickerAsync(options);
|
||||||
if (selected.Count == 1)
|
if (selected.Count == 1)
|
||||||
OpenOrInitRepository(selected[0].Path.LocalPath);
|
OpenOrInitRepository(selected[0].Path.LocalPath);
|
||||||
|
|
Loading…
Reference in a new issue