2022-02-09 22:27:46 -08:00
|
|
|
|
using System;
|
|
|
|
|
|
2024-03-17 18:37:06 -07:00
|
|
|
|
namespace SourceGit.Commands
|
|
|
|
|
{
|
|
|
|
|
public class GC : Command
|
|
|
|
|
{
|
|
|
|
|
public GC(string repo, Action<string> outputHandler)
|
|
|
|
|
{
|
2024-02-05 23:08:37 -08:00
|
|
|
|
_outputHandler = outputHandler;
|
|
|
|
|
WorkingDirectory = repo;
|
|
|
|
|
Context = repo;
|
2022-02-09 22:27:46 -08:00
|
|
|
|
TraitErrorAsOutput = true;
|
2024-10-17 00:50:42 -07:00
|
|
|
|
Args = "gc --prune=now";
|
2022-02-09 22:27:46 -08:00
|
|
|
|
}
|
|
|
|
|
|
2024-03-17 18:37:06 -07:00
|
|
|
|
protected override void OnReadline(string line)
|
|
|
|
|
{
|
2024-02-05 23:08:37 -08:00
|
|
|
|
_outputHandler?.Invoke(line);
|
2022-02-09 22:27:46 -08:00
|
|
|
|
}
|
2024-02-05 23:08:37 -08:00
|
|
|
|
|
2024-03-17 18:37:06 -07:00
|
|
|
|
private readonly Action<string> _outputHandler;
|
2022-02-09 22:27:46 -08:00
|
|
|
|
}
|
2024-03-31 01:54:29 -07:00
|
|
|
|
}
|