feat(submodules): add submodule management and recursive clone
Add a new backend module to manage Git submodules (list, initialize/update, stage, sync, add) and expose Tauri commands (list_submodules, submodule_action, add_submodule). The implementation enforces safe relative paths, a maximum nesting depth, and guards (dirty/conflicted checks and initialization/no-op semantics) to avoid unsafe operations. Refactor clone logic to a testable run_git_clone_command and enable automatic initialization of submodules during clone by passing --recurse-submodules. Also disallow certain submodule-related custom clone flags so callers cannot override this behaviour. Update README with a Submodules section and add frontend components and types to surface submodule UI (dialogs, toolbar badge). Unit tests were added for submodule discovery, initialization/update semantics, and recursive clone behavior.
This commit is contained in:
@@ -22,10 +22,29 @@ Fast, simple, and designed for developers who want a clean Git experience withou
|
||||
- 📦 Repository management
|
||||
- ☁️ GitHub, GitLab, Azure DevOps, and Gitea integrations
|
||||
- 🗄️ Git LFS detection, tracking and object management
|
||||
- 🧩 Submodule management, including nested repositories
|
||||
- 🎨 Modern and intuitive UI
|
||||
|
||||
---
|
||||
|
||||
## Submodules
|
||||
|
||||
Cloning automatically downloads and initializes submodules, including nested
|
||||
submodules, at their recorded commits. The Submodules toolbar badge counts modules
|
||||
that still need initialization. After a successful pull, Gitty offers to initialize
|
||||
missing modules; choosing **Later** keeps the badge visible.
|
||||
|
||||
Open a repository and select **Submodules** in the repository toolbar. The dialog
|
||||
shows each submodule's recorded commit (from its parent's index), checked-out
|
||||
commit, and local changes. You can add a submodule, initialize it, check out its
|
||||
recorded commit, stage a changed reference, synchronize its URL from `.gitmodules`,
|
||||
or open it as a repository tab. Nested submodules are included by default.
|
||||
|
||||
Checking out a recorded commit is blocked when the submodule has local changes;
|
||||
commit or stash them in that repository first. Adding a submodule stages
|
||||
`.gitmodules` and the new reference. Commit these changes in the parent repository.
|
||||
Network operations use your configured Git credential helpers or SSH credentials.
|
||||
|
||||
## 📸 Preview
|
||||
|
||||
> Screenshots comes later.
|
||||
|
||||
Reference in New Issue
Block a user