mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-10-31 13:03:20 -07:00
refactor: use '\0' instead of '$' to split fields
This commit is contained in:
parent
2aa6383f41
commit
5bad969bb7
2 changed files with 4 additions and 4 deletions
|
@ -14,7 +14,7 @@ namespace SourceGit.Commands
|
|||
{
|
||||
WorkingDirectory = repo;
|
||||
Context = repo;
|
||||
Args = "branch -l --all -v --format=\"%(refname)$%(objectname)$%(HEAD)$%(upstream)$%(upstream:trackshort)\"";
|
||||
Args = "branch -l --all -v --format=\"%(refname)%00%(objectname)%00%(HEAD)%00%(upstream)%00%(upstream:trackshort)\"";
|
||||
}
|
||||
|
||||
public List<Models.Branch> Result()
|
||||
|
@ -37,7 +37,7 @@ namespace SourceGit.Commands
|
|||
|
||||
private Models.Branch ParseLine(string line)
|
||||
{
|
||||
var parts = line.Split('$');
|
||||
var parts = line.Split('\0');
|
||||
if (parts.Length != 5)
|
||||
return null;
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace SourceGit.Commands
|
|||
{
|
||||
Context = repo;
|
||||
WorkingDirectory = repo;
|
||||
Args = "tag -l --sort=-creatordate --format=\"$%(refname)$%(objectname)$%(*objectname)\"";
|
||||
Args = "tag -l --sort=-creatordate --format=\"%(refname)%00%(objectname)%00%(*objectname)\"";
|
||||
}
|
||||
|
||||
public List<Models.Tag> Result()
|
||||
|
@ -32,7 +32,7 @@ namespace SourceGit.Commands
|
|||
|
||||
private Models.Tag ParseLine(string line)
|
||||
{
|
||||
var subs = line.Split('$', StringSplitOptions.RemoveEmptyEntries);
|
||||
var subs = line.Split('\0', StringSplitOptions.RemoveEmptyEntries);
|
||||
if (subs.Length == 2)
|
||||
{
|
||||
return new Models.Tag()
|
||||
|
|
Loading…
Reference in a new issue