mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
feat(*): 为 Pull、Fetch、Push 增加 --recurse-submodules 选项参数
This commit is contained in:
parent
d29e5def4b
commit
ceff6ef102
8 changed files with 84 additions and 26 deletions
|
@ -448,12 +448,13 @@ namespace SourceGit.Git {
|
|||
/// Fetch remote changes
|
||||
/// </summary>
|
||||
/// <param name="remote"></param>
|
||||
/// <param name="submod">submod</param>
|
||||
/// <param name="prune"></param>
|
||||
/// <param name="onProgress"></param>
|
||||
public void Fetch(Remote remote, bool prune, Action<string> onProgress) {
|
||||
public void Fetch(Remote remote, string submod, bool prune, Action<string> onProgress) {
|
||||
isWatcherDisabled = true;
|
||||
|
||||
var args = "-c credential.helper=manager fetch --progress --verbose ";
|
||||
var args = $"-c credential.helper=manager fetch --progress --verbose {submod} ";
|
||||
|
||||
if (prune) args += "--prune ";
|
||||
|
||||
|
@ -475,14 +476,15 @@ namespace SourceGit.Git {
|
|||
/// </summary>
|
||||
/// <param name="remote">remote</param>
|
||||
/// <param name="branch">branch</param>
|
||||
/// <param name="submod">submod</param>
|
||||
/// <param name="onProgress">Progress message handler.</param>
|
||||
/// <param name="rebase">Use rebase instead of merge.</param>
|
||||
/// <param name="autostash">Auto stash local changes.</param>
|
||||
/// <param name="onProgress">Progress message handler.</param>
|
||||
public void Pull(string remote, string branch, Action<string> onProgress, bool rebase = false, bool autostash = false) {
|
||||
public void Pull(string remote, string branch, string submod, Action<string> onProgress, bool rebase = false, bool autostash = false) {
|
||||
isWatcherDisabled = true;
|
||||
|
||||
var args = "-c credential.helper=manager pull --verbose --progress ";
|
||||
var args = $"-c credential.helper=manager pull --verbose --progress {submod} ";
|
||||
var needPopStash = false;
|
||||
|
||||
if (rebase) args += "--rebase ";
|
||||
|
@ -518,14 +520,15 @@ namespace SourceGit.Git {
|
|||
/// <param name="remote">Remote</param>
|
||||
/// <param name="localBranch">Local branch name</param>
|
||||
/// <param name="remoteBranch">Remote branch name</param>
|
||||
/// <param name="submod">submod</param>
|
||||
/// <param name="onProgress">Progress message handler.</param>
|
||||
/// <param name="withTags">Push tags</param>
|
||||
/// <param name="track">Create track reference</param>
|
||||
/// <param name="force">Force push</param>
|
||||
public void Push(string remote, string localBranch, string remoteBranch, Action<string> onProgress, bool withTags = false, bool track = false, bool force = false) {
|
||||
public void Push(string remote, string localBranch, string remoteBranch, string submod, Action<string> onProgress, bool withTags = false, bool track = false, bool force = false) {
|
||||
isWatcherDisabled = true;
|
||||
|
||||
var args = "-c credential.helper=manager push --progress --verbose ";
|
||||
var args = $"-c credential.helper=manager push --progress --verbose {submod} ";
|
||||
|
||||
if (withTags) args += "--tags ";
|
||||
if (track) args += "-u ";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue