-
Notifications
You must be signed in to change notification settings - Fork 1
Fix build failures, config loading, and wire remaining CLI commands #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7e41e42
c6be957
01dfd00
42725ad
53878fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -308,21 +308,11 @@ impl GitOperations for GixOperations { | |
|
|
||
| /// Add a new submodule to the repository | ||
| fn add_submodule(&mut self, opts: &SubmoduleAddOptions) -> Result<()> { | ||
| // 2. Check if submodule already exists (do this before borrowing self mutably) | ||
| let entries = self.read_gitmodules()?; | ||
| let existing_names = &entries.submodule_names(); | ||
| if existing_names | ||
| .as_ref() | ||
| .map_or(false, |names| names.contains(&opts.name)) | ||
| { | ||
| return Err(anyhow::anyhow!( | ||
| "Submodule '{}' already exists. Use 'submod update' if you want to change its options", | ||
| opts.name | ||
| )); | ||
| } | ||
| let (name, entry) = opts.clone().into_entries_tuple(); | ||
| let merged_entries = entries.add_submodule(name, entry); | ||
| self.write_gitmodules(&merged_entries) | ||
| // gix does not support cloning in add_submodule; fall through to git2/CLI. | ||
| Err(anyhow::anyhow!( | ||
| "gix add_submodule not implemented: use git2 or CLI fallback for '{}'", | ||
| opts.name | ||
| )) | ||
|
Comment on lines
+311
to
+315
|
||
| } | ||
|
|
||
| /// Initialize a submodule by reading its configuration and setting it up | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -31,16 +31,11 @@ mod utilities; | |||||
|
|
||||||
| use crate::commands::{Cli, Commands}; | ||||||
| use crate::git_manager::GitManager; | ||||||
| use crate::options::{ | ||||||
| SerializableBranch as Branch, SerializableFetchRecurse, SerializableIgnore, SerializableUpdate, | ||||||
| }; | ||||||
| use crate::utilities::{get_name, get_sparse_paths, name_from_osstring, name_from_url, set_path}; | ||||||
| use crate::options::SerializableBranch as Branch; | ||||||
| use crate::utilities::{get_name, get_sparse_paths, set_path}; | ||||||
| use anyhow::Result; | ||||||
| use clap::Parser; | ||||||
| use std::ffi::OsString; | ||||||
| use std::str::FromStr; | ||||||
| use submod::options::SerializableBranch; | ||||||
|
|
||||||
| use clap_complete::generate; | ||||||
|
||||||
| use clap_complete::generate; | |
| use clap_complete::generate; |
Uh oh!
There was an error while loading. Please reload this page.