cleanup<*>: run vs code cleanup to format codestyle and remove unused references

This commit is contained in:
leo 2021-08-05 15:54:00 +08:00
parent 37559b60d4
commit 2cf7192ec4
41 changed files with 77 additions and 89 deletions

View file

@ -45,7 +45,7 @@ namespace SourceGit.Commands {
var when = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(timestamp).ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");
var blameLine = new Models.BlameLine() {
LineNumber = $"{data.Lines.Count+1}",
LineNumber = $"{data.Lines.Count + 1}",
CommitSHA = commit,
Author = author,
Time = when,

View file

@ -101,7 +101,7 @@ namespace SourceGit.Commands {
#endif
return;
}
if (string.IsNullOrEmpty(e.Data)) return;
if (TraitErrorAsOutput) OnReadline(e.Data);
@ -147,7 +147,7 @@ namespace SourceGit.Commands {
start.StandardErrorEncoding = Encoding.UTF8;
if (!string.IsNullOrEmpty(Cwd)) start.WorkingDirectory = Cwd;
var proc = new Process() { StartInfo = start };
try {
proc.Start();
@ -174,6 +174,6 @@ namespace SourceGit.Commands {
/// 调用Exec时的读取函数
/// </summary>
/// <param name="line"></param>
public virtual void OnReadline(string line) {}
public virtual void OnReadline(string line) { }
}
}

View file

@ -117,7 +117,7 @@ namespace SourceGit.Commands {
}
}
decorators.Sort((l, r) => {
decorators.Sort((l, r) => {
if (l.Type != r.Type) {
return (int)l.Type - (int)r.Type;
} else {

View file

@ -4,7 +4,7 @@ namespace SourceGit.Commands {
/// </summary>
public class Config : Command {
public Config() {}
public Config() { }
public Config(string repo) {
Cwd = repo;

View file

@ -71,7 +71,7 @@ namespace SourceGit.Commands {
}
}
}
private void ProcessChanges() {
if (deleted.Any()) {
if (added.Count == deleted.Count) {

View file

@ -12,7 +12,7 @@ namespace SourceGit.Commands {
this.repo = repo;
}
public void Whole() {
public void Whole() {
new Reset(repo, "HEAD", "--hard").Exec();
new Clean(repo).Exec();
}

View file

@ -69,7 +69,7 @@ namespace SourceGit.Commands {
private void OnTick(object o) {
var now = DateTime.Now.ToFileTime();
if (nextFetchPoint > now) return;
Models.Watcher.SetEnabled(cmd.Cwd, false);
cmd.Exec();
nextFetchPoint = DateTime.Now.AddMinutes(10).ToFileTime();