mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04:59 +00:00
style: add .editorconfig for code formatting. see issu #25
This commit is contained in:
parent
a8eeea4f78
commit
18aaa0a143
225 changed files with 7781 additions and 3911 deletions
|
@ -1,30 +1,38 @@
|
|||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SourceGit.ViewModels {
|
||||
public class Init : Popup {
|
||||
public string TargetPath {
|
||||
namespace SourceGit.ViewModels
|
||||
{
|
||||
public class Init : Popup
|
||||
{
|
||||
public string TargetPath
|
||||
{
|
||||
get => _targetPath;
|
||||
set => SetProperty(ref _targetPath, value);
|
||||
}
|
||||
|
||||
public Init(string path) {
|
||||
public Init(string path)
|
||||
{
|
||||
TargetPath = path;
|
||||
View = new Views.Init() { DataContext = this };
|
||||
}
|
||||
|
||||
public override Task<bool> Sure() {
|
||||
public override Task<bool> Sure()
|
||||
{
|
||||
ProgressDescription = $"Initialize git repository at: '{_targetPath}'";
|
||||
|
||||
return Task.Run(() => {
|
||||
return Task.Run(() =>
|
||||
{
|
||||
var succ = new Commands.Init(HostPageId, _targetPath).Exec();
|
||||
if (!succ) return false;
|
||||
|
||||
var gitDir = Path.GetFullPath(Path.Combine(_targetPath, ".git"));
|
||||
|
||||
CallUIThread(() => {
|
||||
|
||||
CallUIThread(() =>
|
||||
{
|
||||
var repo = Preference.AddRepository(_targetPath, gitDir);
|
||||
var node = new RepositoryNode() {
|
||||
var node = new RepositoryNode()
|
||||
{
|
||||
Id = repo.FullPath,
|
||||
Name = Path.GetFileName(repo.FullPath),
|
||||
Bookmark = 0,
|
||||
|
@ -39,4 +47,4 @@ namespace SourceGit.ViewModels {
|
|||
|
||||
private string _targetPath;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue