public IList<GitItemStatus> GetStagedFiles()
{
string status = RunGitCmd("diff -M -C -z --cached --name-status", SystemEncoding);
if (status.Length < 50 && status.Contains("fatal: No HEAD commit to compare"))
{
//This command is a little more expensive because it will return both staged and unstaged files
string command = GitCommandHelpers.GetAllChangedFilesCmd(true, UntrackedFilesMode.No);
status = RunGitCmd(command, SystemEncoding);
IList<GitItemStatus> stagedFiles = GitCommandHelpers.GetAllChangedFilesFromString(this, status, false);
return stagedFiles.Where(f => f.IsStaged).ToList();
}
return GitCommandHelpers.GetAllChangedFilesFromString(this, status, true);
}