-
Notifications
You must be signed in to change notification settings - Fork 385
Expand file tree
/
Copy pathGetFileChangeForAI.cs
More file actions
28 lines (24 loc) · 862 Bytes
/
GetFileChangeForAI.cs
File metadata and controls
28 lines (24 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Text;
using System.Threading.Tasks;
namespace SourceGit.Commands
{
public class GetFileChangeForAI : Command
{
public GetFileChangeForAI(string repo, string file, string originalFile)
{
WorkingDirectory = repo;
Context = repo;
var builder = new StringBuilder();
builder.Append("diff --no-color --no-ext-diff --diff-algorithm=minimal --cached -- ");
if (!string.IsNullOrEmpty(originalFile) && !file.Equals(originalFile, StringComparison.Ordinal))
builder.Append(originalFile.Quoted()).Append(' ');
builder.Append(file.Quoted());
Args = builder.ToString();
}
public async Task<Result> ReadAsync()
{
return await ReadToEndAsync().ConfigureAwait(false);
}
}
}