enhance: simpfy the way to lock a worktree

This commit is contained in:
leo 2024-06-27 19:19:21 +08:00
parent 8a8aabede3
commit fa2c7c0e18
No known key found for this signature in database
10 changed files with 25 additions and 125 deletions

View file

@ -88,12 +88,9 @@ namespace SourceGit.Commands
return Exec();
}
public bool Lock(string fullpath, string reason)
public bool Lock(string fullpath)
{
if (string.IsNullOrEmpty(reason))
Args = $"worktree lock \"{fullpath}\"";
else
Args = $"worktree lock --reason \"{reason}\" \"{fullpath}\"";
Args = $"worktree lock \"{fullpath}\"";
return Exec();
}