Skip to content

Commit 3ee3c4e

Browse files
committed
refactor: --recursive will always be enabled while initializing or updating submodules
Signed-off-by: leo <[email protected]>
1 parent 36702b9 commit 3ee3c4e

File tree

11 files changed

+11
-25
lines changed

11 files changed

+11
-25
lines changed

src/Commands/Submodule.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,13 @@ public async Task<bool> SetBranchAsync(string path, string branch)
4343
return await ExecAsync().ConfigureAwait(false);
4444
}
4545

46-
public async Task<bool> UpdateAsync(List<string> modules, bool init, bool recursive, bool useRemote = false)
46+
public async Task<bool> UpdateAsync(List<string> modules, bool init = false, bool useRemote = false)
4747
{
4848
var builder = new StringBuilder();
49-
builder.Append("submodule update");
49+
builder.Append("submodule update --recursive");
5050

5151
if (init)
5252
builder.Append(" --init");
53-
if (recursive)
54-
builder.Append(" --recursive");
5553
if (useRemote)
5654
builder.Append(" --remote");
5755
if (modules.Count > 0)

src/Resources/Locales/en_US.axaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,6 @@
872872
<x:String x:Key="Text.UpdateSubmodules" xml:space="preserve">Update Submodules</x:String>
873873
<x:String x:Key="Text.UpdateSubmodules.All" xml:space="preserve">All submodules</x:String>
874874
<x:String x:Key="Text.UpdateSubmodules.Init" xml:space="preserve">Initialize as needed</x:String>
875-
<x:String x:Key="Text.UpdateSubmodules.Recursive" xml:space="preserve">Traverse submodules recursively</x:String>
876875
<x:String x:Key="Text.UpdateSubmodules.Target" xml:space="preserve">Submodule:</x:String>
877876
<x:String x:Key="Text.UpdateSubmodules.UpdateToRemoteTrackingBranch" xml:space="preserve">Update to submodule's remote tracking branch</x:String>
878877
<x:String x:Key="Text.URL" xml:space="preserve">URL:</x:String>

src/ViewModels/Checkout.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public override async Task<bool> Sure()
7373
if (submodules.Count > 0)
7474
await new Commands.Submodule(_repo.FullPath)
7575
.Use(log)
76-
.UpdateAsync(submodules, false, true);
76+
.UpdateAsync(submodules);
7777

7878
if (needPopStash)
7979
await new Commands.Stash(_repo.FullPath)

src/ViewModels/CheckoutAndFastForward.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public override async Task<bool> Sure()
7878
if (submodules.Count > 0)
7979
await new Commands.Submodule(_repo.FullPath)
8080
.Use(log)
81-
.UpdateAsync(submodules, false, true);
81+
.UpdateAsync(submodules);
8282

8383
if (needPopStash)
8484
await new Commands.Stash(_repo.FullPath)

src/ViewModels/CheckoutCommit.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public override async Task<bool> Sure()
7373
if (submodules.Count > 0)
7474
await new Commands.Submodule(_repo.FullPath)
7575
.Use(log)
76-
.UpdateAsync(submodules, false, true);
76+
.UpdateAsync(submodules);
7777

7878
if (needPop)
7979
await new Commands.Stash(_repo.FullPath)

src/ViewModels/Clone.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public override async Task<bool> Sure()
144144
if (submodules.Count > 0)
145145
await new Commands.Submodule(path)
146146
.Use(log)
147-
.UpdateAsync(submodules, true, true);
147+
.UpdateAsync(submodules, true);
148148
}
149149

150150
log.Complete();

src/ViewModels/CreateBranch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public override async Task<bool> Sure()
157157
if (submodules.Count > 0)
158158
await new Commands.Submodule(_repo.FullPath)
159159
.Use(log)
160-
.UpdateAsync(submodules, false, true);
160+
.UpdateAsync(submodules);
161161

162162
if (needPopStash)
163163
await new Commands.Stash(_repo.FullPath)

src/ViewModels/Merge.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public override async Task<bool> Sure()
9595
if (submodules.Count > 0)
9696
await new Commands.Submodule(_repo.FullPath)
9797
.Use(log)
98-
.UpdateAsync(submodules, false, true);
98+
.UpdateAsync(submodules);
9999
}
100100

101101
log.Complete();

src/ViewModels/Pull.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public override async Task<bool> Sure()
137137
{
138138
var submodules = await new Commands.QueryUpdatableSubmodules(_repo.FullPath, false).GetResultAsync();
139139
if (submodules.Count > 0)
140-
await new Commands.Submodule(_repo.FullPath).Use(log).UpdateAsync(submodules, false, true);
140+
await new Commands.Submodule(_repo.FullPath).Use(log).UpdateAsync(submodules);
141141

142142
if (needPopStash)
143143
await new Commands.Stash(_repo.FullPath).Use(log).PopAsync("stash@{0}");

src/ViewModels/UpdateSubmodules.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,6 @@ public bool EnableInit
3939
set;
4040
} = true;
4141

42-
public bool EnableRecursive
43-
{
44-
get;
45-
set;
46-
} = true;
47-
4842
public bool EnableRemote
4943
{
5044
get;
@@ -93,7 +87,7 @@ public override async Task<bool> Sure()
9387

9488
await new Commands.Submodule(_repo.FullPath)
9589
.Use(log)
96-
.UpdateAsync(targets, EnableInit, EnableRecursive, EnableRemote);
90+
.UpdateAsync(targets, EnableInit, EnableRemote);
9791

9892
log.Complete();
9993
_repo.MarkSubmodulesDirtyManually();

0 commit comments

Comments
 (0)