@@ -100,14 +100,52 @@ public static string[] AllChanges()
100
100
public static string [ ] ChangedFiles ( )
101
101
{
102
102
103
- return AllChanges ( ) . Except ( UntrackedFiles ( ) ) . ToArray ( ) ;
103
+ var process = Process . Start ( new ProcessStartInfo
104
+ {
105
+ FileName = GitPath ,
106
+ Arguments = "status --short --untracked-files=no --porcelain" ,
107
+ UseShellExecute = false ,
108
+ RedirectStandardOutput = true ,
109
+ RedirectStandardError = true ,
110
+ CreateNoWindow = true
111
+ } ) ;
112
+
113
+ var changes = new List < string > ( ) ;
114
+
115
+ while ( process ? . StandardOutput . ReadLine ( ) is string line )
116
+ {
117
+
118
+ changes . Add ( line . Trim ( ) . TrimStart ( 'M' , ' ' ) ) ;
119
+
120
+ }
121
+
122
+ return changes . ToArray ( ) ;
104
123
105
124
}
106
125
107
126
public static string [ ] UntrackedFiles ( )
108
127
{
109
128
110
- return AllChanges ( ) . Where ( file => file . StartsWith ( "??" ) ) . ToArray ( ) ;
129
+ var process = Process . Start ( new ProcessStartInfo
130
+ {
131
+ FileName = GitPath ,
132
+ Arguments = "ls-files --others --exclude-standard" ,
133
+ UseShellExecute = false ,
134
+ RedirectStandardOutput = true ,
135
+ RedirectStandardError = true ,
136
+ CreateNoWindow = true
137
+ } ) ;
138
+
139
+ var changes = new List < string > ( ) ;
140
+
141
+ while ( process ? . StandardOutput . ReadLine ( ) is string line )
142
+ {
143
+
144
+ changes . Add ( line . Trim ( ) ) ;
145
+
146
+ }
147
+
148
+ return changes . ToArray ( ) ;
111
149
112
150
}
113
151
0 commit comments