sourcegit/src/Commands/Pull.cs
leo 09d0122e26
refactor: rewrite git pull command
If we do not provide pulling remote branch, it will auto fetch all branches first.

Signed-off-by: leo <longshuang@msn.cn>
2025-05-21 17:18:25 +08:00

18 lines
476 B
C#

namespace SourceGit.Commands
{
public class Pull : Command
{
public Pull(string repo, string remote, string branch, bool useRebase)
{
WorkingDirectory = repo;
Context = repo;
SSHKey = new Config(repo).Get($"remote.{remote}.sshkey");
Args = "pull --verbose --progress ";
if (useRebase)
Args += "--rebase=true ";
Args += $"{remote} {branch}";
}
}
}