Skip to content

Commit

Permalink
Fix Add not defaulting to --all on empty sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
jzebedee committed Mar 15, 2019
1 parent bc221b8 commit ba7616f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/corgit/GitArguments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,18 @@ public static IEnumerable<string> Log(LogOptions options = default, IEnumerable<
public static IEnumerable<string> Add(IEnumerable<string> paths = null)
{
yield return "add";
if (paths == null)
{
yield return "--all";
}
else
if (paths?.Any() ?? false)
{
yield return "--";
foreach (var path in paths.Select(QuoteEscape))
{
yield return path;
}
}
else
{
yield return "--all";
}
}

public static IEnumerable<string> Remove(IEnumerable<string> paths)
Expand Down

0 comments on commit ba7616f

Please sign in to comment.