From e78469605824db45c21d256a154d31f5f2c52123 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 6 Feb 2025 10:19:43 +0800 Subject: [PATCH] enhance: add a checkbox to toggle `Initialize & update submodules` after clone Signed-off-by: leo --- src/Resources/Locales/en_US.axaml | 1 + src/Resources/Locales/zh_CN.axaml | 1 + src/Resources/Locales/zh_TW.axaml | 1 + src/ViewModels/Clone.cs | 17 +++++++++++++---- src/Views/Clone.axaml | 7 ++++++- 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 22cfd398..5124eb05 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -97,6 +97,7 @@ Local Name: Repository name. Optional. Parent Folder: + Initialize & update submodules Repository URL: CLOSE Editor diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index f2a51970..4d2dfedb 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -100,6 +100,7 @@ 本地仓库名 : 本地仓库目录的名字,选填。 父级目录 : + 初始化并更新子模块 远程仓库 : 关闭 提交信息编辑器 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index dd7aad39..421dbd26 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -100,6 +100,7 @@ 本機存放庫名稱: 本機存放庫目錄的名稱,選填。 父級目錄: + 初始化並複製子模組 遠端存放庫: 關閉 提交訊息編輯器 diff --git a/src/ViewModels/Clone.cs b/src/ViewModels/Clone.cs index 924cbc26..3123d62a 100644 --- a/src/ViewModels/Clone.cs +++ b/src/ViewModels/Clone.cs @@ -53,6 +53,12 @@ namespace SourceGit.ViewModels set => SetProperty(ref _extraArgs, value); } + public bool InitAndUpdateSubmodules + { + get; + set; + } = true; + public Clone(string pageId) { _pageId = pageId; @@ -128,11 +134,14 @@ namespace SourceGit.ViewModels } // individually update submodule (if any) - var submoduleList = new Commands.QuerySubmodules(path).Result(); - foreach (var submodule in submoduleList) + if (InitAndUpdateSubmodules) { - var update = new Commands.Submodule(path); - update.Update(submodule.Path, true, true, false, SetProgressDescription); + var submoduleList = new Commands.QuerySubmodules(path).Result(); + foreach (var submodule in submoduleList) + { + var update = new Commands.Submodule(path); + update.Update(submodule.Path, true, true, false, SetProgressDescription); + } } CallUIThread(() => diff --git a/src/Views/Clone.axaml b/src/Views/Clone.axaml index 25c46a00..84d1dd74 100644 --- a/src/Views/Clone.axaml +++ b/src/Views/Clone.axaml @@ -10,7 +10,7 @@ - + + +