mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-21 21:30:37 +08:00
enhance: set SuggestedStartLocation to default clone dir when open local repository (#293)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user