code_style: run dotnet format

This commit is contained in:
leo 2024-06-06 15:31:02 +08:00
parent ed62174942
commit 4610f702b3
No known key found for this signature in database
GPG key ID: B528468E49CD0E58
29 changed files with 48 additions and 76 deletions

View file

@ -52,7 +52,7 @@ namespace SourceGit.ViewModels
{
get => Type == BranchTreeNodeType.Branch;
}
public bool IsDetachedHead
{
get => Type == BranchTreeNodeType.DetachedHead;
@ -219,7 +219,7 @@ namespace SourceGit.ViewModels
start = sepIdx + 1;
sepIdx = branch.Name.IndexOf('/', start);
}
lastFolder.Children.Add(new BranchTreeNode()
{
Name = Path.GetFileName(branch.Name),
@ -242,7 +242,7 @@ namespace SourceGit.ViewModels
{
return l.Name.CompareTo(r.Name);
}
return (int)l.Type - (int)r.Type;
});

View file

@ -2,14 +2,14 @@
namespace SourceGit.ViewModels
{
public class CheckoutCommit: Popup
public class CheckoutCommit : Popup
{
public Models.Commit Commit
{
get;
private set;
}
public bool HasLocalChanges
{
get => _repo.WorkingCopyChangesCount > 0;
@ -32,7 +32,7 @@ namespace SourceGit.ViewModels
{
_repo.SetWatcherEnabled(false);
ProgressDescription = $"Checkout Commit '{Commit.SHA}' ...";
return Task.Run(() =>
{
var needPopStash = false;

View file

@ -228,7 +228,7 @@ namespace SourceGit.ViewModels
e.Handled = true;
};
menu.Items.Add(copyFileName);
return menu;
}

View file

@ -2,7 +2,7 @@
using System.Threading.Tasks;
namespace SourceGit.ViewModels
{
{
public class CreateBranch : Popup
{
[Required(ErrorMessage = "Branch name is required!")]
@ -19,13 +19,13 @@ namespace SourceGit.ViewModels
get;
private set;
}
public Models.DealWithLocalChanges PreAction
{
get => _preAction;
set => SetProperty(ref _preAction, value);
}
public bool CheckoutAfterCreated
{
get;

View file

@ -58,7 +58,7 @@ namespace SourceGit.ViewModels
{
SetProgressDescription("Deleting tracking remote branch...");
Commands.Branch.DeleteRemote(_repo.FullPath, TrackingRemoteBranch.Remote, TrackingRemoteBranch.Name);
}
}
}
else
{

View file

@ -17,7 +17,7 @@ namespace SourceGit.ViewModels
Targets = branches;
View = new Views.DeleteMultipleBranches() { DataContext = this };
}
public override Task<bool> Sure()
{
_repo.SetWatcherEnabled(false);

View file

@ -122,7 +122,7 @@ namespace SourceGit.ViewModels
if (latest.TextDiff != null)
{
var repo = Preference.FindRepository(_repo);
if (repo != null && repo.Submodules.Contains(_option.Path))
if (repo != null && repo.Submodules.Contains(_option.Path))
{
var submoduleDiff = new Models.SubmoduleDiff();
var submoduleRoot = $"{_repo}/{_option.Path}".Replace("\\", "/");
@ -164,7 +164,7 @@ namespace SourceGit.ViewModels
{
var fullPath = Path.Combine(_repo, _option.Path);
(imgDiff.Old, imgDiff.OldFileSize) = BitmapFromRevisionFile(_repo, "HEAD", oldPath);
if (File.Exists(fullPath))
{
imgDiff.New = new Bitmap(fullPath);

View file

@ -136,7 +136,7 @@ namespace SourceGit.ViewModels
}
needPopStash = true;
}
}
else if (_preAction == Models.DealWithLocalChanges.Discard)
{
SetProgressDescription("Discard local changes ...");

View file

@ -192,7 +192,7 @@ namespace SourceGit.ViewModels
e.Handled = true;
};
menu.Items.Add(copyFileName);
return menu;
}

View file

@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Avalonia.Controls;
using Avalonia.Threading;

View file

@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Platform.Storage;
using Avalonia.Threading;
@ -793,7 +792,7 @@ namespace SourceGit.ViewModels
App.CopyText(change.Path);
e.Handled = true;
};
var copyFileName = new MenuItem();
copyFileName.Header = App.Text("CopyFileName");
copyFileName.Icon = App.CreateMenuIcon("Icons.Copy");