Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix status parsing issue with renamed files

  • Loading branch information...
commit b4401ab72356dbf29fb4e8171dcf998b3446d827 1 parent 4b9df7c
Yiyi Sun authored
Showing with 8 additions and 6 deletions.
  1. +2 −1  GitFileStatus.cs
  2. +6 −5 GitFileStatusTracker.cs
3  GitFileStatus.cs
View
@@ -30,7 +30,8 @@ public class GitFile : INotifyPropertyChanged
{
return Status == GitFileStatus.Added ||
Status == GitFileStatus.Staged ||
- Status == GitFileStatus.Removed;
+ Status == GitFileStatus.Removed ||
+ Status == GitFileStatus.Renamed;
}
}
11 GitFileStatusTracker.cs
View
@@ -757,8 +757,8 @@ public string DiffFile(string fileName)
if (!this.HasGitRepository) return "";
var tmpFileName = Path.ChangeExtension(Path.GetTempFileName(), ".diff");
-
- if (head == null)
+ var status = GetFileStatus(fileName);
+ if (head == null || status == GitFileStatus.New || status == GitFileStatus.Added)
{
tmpFileName = Path.ChangeExtension(tmpFileName, Path.GetExtension(fileName));
File.Copy(GetFullPath(fileName), tmpFileName);
@@ -996,9 +996,10 @@ public IList<GitFile> ParseGitStatus(string statusString)
if (splitIndex < 0)
{
- status = files[n];
- fileName = files[n + 1];
- n++;
+ //status = files[n];
+ //fileName = files[n + 1];
+ //n++;
+ continue;
}
else
{
Please sign in to comment.
Something went wrong with that request. Please try again.