mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-23 19:34:59 +00:00
code_style: general cleanup (#1415)
* code_style: general cleanup * code_style: whitespace cleanup
This commit is contained in:
parent
35eda489be
commit
ffac71b15f
89 changed files with 161 additions and 243 deletions
|
@ -51,7 +51,7 @@ namespace SourceGit.Commands
|
|||
|
||||
private void ParseLine(string line)
|
||||
{
|
||||
if (line.IndexOf('\0', StringComparison.Ordinal) >= 0)
|
||||
if (line.Contains('\0', StringComparison.Ordinal))
|
||||
{
|
||||
_result.IsBinary = true;
|
||||
_result.LineInfos.Clear();
|
||||
|
|
|
@ -194,7 +194,7 @@ namespace SourceGit.Commands
|
|||
|
||||
private void HandleOutput(string line, List<string> errs)
|
||||
{
|
||||
line = line ?? string.Empty;
|
||||
line ??= string.Empty;
|
||||
Log?.AppendLine(line);
|
||||
|
||||
// Lines to hide in error message.
|
||||
|
|
|
@ -34,6 +34,6 @@ namespace SourceGit.Commands
|
|||
return succ;
|
||||
}
|
||||
|
||||
private string _tmpFile = string.Empty;
|
||||
private readonly string _tmpFile;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace SourceGit.Commands
|
|||
[GeneratedRegex(@"^(.+)\s+([\w.]+)\s+\w+:(\d+)$")]
|
||||
private static partial Regex REG_LOCK();
|
||||
|
||||
class SubCmd : Command
|
||||
private class SubCmd : Command
|
||||
{
|
||||
public SubCmd(string repo, string args, Models.ICommandLog log)
|
||||
{
|
||||
|
|
|
@ -90,6 +90,6 @@ namespace SourceGit.Commands
|
|||
|
||||
private List<Models.InteractiveCommit> _commits = [];
|
||||
private Models.InteractiveCommit _current = null;
|
||||
private string _boundary = "";
|
||||
private readonly string _boundary;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,9 +16,6 @@ namespace SourceGit.Commands
|
|||
|
||||
public long Result()
|
||||
{
|
||||
if (_result != 0)
|
||||
return _result;
|
||||
|
||||
var rs = ReadToEnd();
|
||||
if (rs.IsSuccess)
|
||||
{
|
||||
|
@ -29,7 +26,5 @@ namespace SourceGit.Commands
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private readonly long _result = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,13 +23,11 @@ namespace SourceGit.Commands
|
|||
_patchBuilder.Append(c.DataForAmend.ObjectHash);
|
||||
_patchBuilder.Append("\t");
|
||||
_patchBuilder.Append(c.OriginalPath);
|
||||
_patchBuilder.Append("\n");
|
||||
}
|
||||
else if (c.Index == Models.ChangeState.Added)
|
||||
{
|
||||
_patchBuilder.Append("0 0000000000000000000000000000000000000000\t");
|
||||
_patchBuilder.Append(c.Path);
|
||||
_patchBuilder.Append("\n");
|
||||
}
|
||||
else if (c.Index == Models.ChangeState.Deleted)
|
||||
{
|
||||
|
@ -37,7 +35,6 @@ namespace SourceGit.Commands
|
|||
_patchBuilder.Append(c.DataForAmend.ObjectHash);
|
||||
_patchBuilder.Append("\t");
|
||||
_patchBuilder.Append(c.Path);
|
||||
_patchBuilder.Append("\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -46,8 +43,9 @@ namespace SourceGit.Commands
|
|||
_patchBuilder.Append(c.DataForAmend.ObjectHash);
|
||||
_patchBuilder.Append("\t");
|
||||
_patchBuilder.Append(c.Path);
|
||||
_patchBuilder.Append("\n");
|
||||
}
|
||||
|
||||
_patchBuilder.Append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue