mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00

- Use new syntex `[...]` instead of `new char[] {...}` to create char arrays - Use `string.ReplaceLineEndings('\n').Split('\n')` instead of `string.Split(['\n', '\r'], StringSplitOptions.RemoveEmptyEntries)` because that the `Signer` part may be missing Signed-off-by: leo <longshuang@msn.cn>
26 lines
662 B
C#
26 lines
662 B
C#
using System;
|
|
|
|
namespace SourceGit.Commands
|
|
{
|
|
public class CountLocalChangesWithoutUntracked : Command
|
|
{
|
|
public CountLocalChangesWithoutUntracked(string repo)
|
|
{
|
|
WorkingDirectory = repo;
|
|
Context = repo;
|
|
Args = "--no-optional-locks status -uno --ignore-submodules=dirty --porcelain";
|
|
}
|
|
|
|
public int Result()
|
|
{
|
|
var rs = ReadToEnd();
|
|
if (rs.IsSuccess)
|
|
{
|
|
var lines = rs.StdOut.Split(['\r', '\n'], StringSplitOptions.RemoveEmptyEntries);
|
|
return lines.Length;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
}
|
|
}
|