code_style: general cleanup (#1428)

This commit is contained in:
Nathan Baulch 2025-06-18 11:29:18 +10:00 committed by GitHub
parent ae46728bbc
commit d404f6dbe2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
48 changed files with 123 additions and 240 deletions

View file

@ -48,16 +48,12 @@ namespace SourceGit.Commands
if (remoteHeads.TryGetValue(b.Upstream, out var upstreamHead))
{
b.IsUpstreamGone = false;
if (b.TrackStatus == null)
b.TrackStatus = new QueryTrackStatus(WorkingDirectory, b.Head, upstreamHead).Result();
b.TrackStatus ??= new QueryTrackStatus(WorkingDirectory, b.Head, upstreamHead).Result();
}
else
{
b.IsUpstreamGone = true;
if (b.TrackStatus == null)
b.TrackStatus = new Models.BranchTrackStatus();
b.TrackStatus ??= new Models.BranchTrackStatus();
}
}
}

View file

@ -24,7 +24,7 @@ namespace SourceGit.Commands
var records = rs.StdOut.Split(_boundary, StringSplitOptions.RemoveEmptyEntries);
foreach (var record in records)
{
var subs = record.Split('\0', StringSplitOptions.None);
var subs = record.Split('\0');
if (subs.Length != 6)
continue;

View file

@ -22,7 +22,7 @@ namespace SourceGit.Commands
}
}
private static bool ExecCmd(string repo, string args, string outputFile, Stream input = null)
private static void ExecCmd(string repo, string args, string outputFile, Stream input = null)
{
var starter = new ProcessStartInfo();
starter.WorkingDirectory = repo;
@ -45,10 +45,7 @@ namespace SourceGit.Commands
proc.StandardInput.Write(new StreamReader(input).ReadToEnd());
proc.StandardOutput.BaseStream.CopyTo(sw);
proc.WaitForExit();
var rs = proc.ExitCode == 0;
proc.Close();
return rs;
}
catch (Exception e)
{
@ -56,7 +53,6 @@ namespace SourceGit.Commands
{
App.RaiseException(repo, "Save file failed: " + e.Message);
});
return false;
}
}
}