feat: Add stash auto-restore functionality (#947) (#948)

This commit is contained in:
GadflyFang 2025-02-06 10:31:46 +08:00 committed by GitHub
parent 942f349275
commit 3ca4dc488c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 41 additions and 8 deletions

View file

@ -73,21 +73,27 @@ namespace SourceGit.Commands
return Exec();
}
public bool Apply(string name)
public bool Apply(string name = null)
{
Args = $"stash apply --index -q {name}";
Args = "stash apply -q";
if (!string.IsNullOrEmpty(name))
Args += $" \"{name}\"";
return Exec();
}
public bool Pop(string name)
public bool Pop(string name = null)
{
Args = $"stash pop --index -q {name}";
Args = "stash pop -q";
if (!string.IsNullOrEmpty(name))
Args += $" \"{name}\"";
return Exec();
}
public bool Drop(string name)
public bool Drop(string name = null)
{
Args = $"stash drop -q {name}";
Args = "stash drop -q";
if (!string.IsNullOrEmpty(name))
Args += $" \"{name}\"";
return Exec();
}