Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ futures.workspace = true
indicatif.workspace = true
itertools.workspace = true
mimalloc = { workspace = true, optional = true }
path-slash.workspace = true
rayon.workspace = true
regex = { workspace = true, default-features = false }
serde_json.workspace = true
Expand Down
9 changes: 3 additions & 6 deletions crates/cli/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use foundry_common::{
};
use foundry_config::{Chain, Config};
use itertools::Itertools;
use path_slash::PathExt;
use regex::Regex;
use serde::de::DeserializeOwned;
use std::{
Expand Down Expand Up @@ -718,13 +719,9 @@ ignore them in the `.gitignore` file."
}

/// Get the URL of a submodule from git config
pub fn submodule_url(self, path: impl AsRef<OsStr>) -> Result<Option<String>> {
pub fn submodule_url(self, path: &Path) -> Result<Option<String>> {
self.cmd()
.args([
"config",
"--get",
&format!("submodule.{}.url", path.as_ref().to_string_lossy()),
])
.args(["config", "--get", &format!("submodule.{}.url", path.to_slash_lossy())])
.get_stdout_lossy()
.map(|url| Some(url.trim().to_string()))
}
Expand Down
1 change: 0 additions & 1 deletion crates/forge/src/cmd/remove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ impl RemoveArgs {
let config = self.load_config()?;
let (root, paths, _) = super::update::dependencies_paths(&self.dependencies, &config)?;
let git_modules = root.join(".git/modules");

let git = Git::new(&root);
let mut lockfile = Lockfile::new(&config.root).with_git(&git);
let _synced = lockfile.sync(config.install_lib_dir())?;
Expand Down
3 changes: 1 addition & 2 deletions crates/forge/tests/cli/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,9 @@ Installing forge-std in [..] (url: Some("https://github.com/foundry-rs/forge-std
};

let remove = |cmd: &mut TestCommand, target: &str| {
// TODO: flaky behavior with URL, sometimes it is None, sometimes it is Some("https://github.com/lib/forge-std")
cmd.forge_fuse().args(["remove", "--force", target]).assert_success().stdout_eq(str![[
r#"
Removing 'forge-std' in [..], (url: [..], tag: None)
Removing 'forge-std' in [..], (url: Some("https://github.com/foundry-rs/forge-std"), tag: None)

"#
]]);
Expand Down
Loading