forked from rust-lang/cargo
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
auto merge of rust-lang#329 : alexcrichton/cargo/fix-git-submodule, r…
…=wycats The fast path bypassed updating the submodule which wasn't correct if we were the first checkout.
- Loading branch information
Showing
2 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -674,3 +674,56 @@ test!(update_with_shared_deps { | |
git = git_project.root().display(), | ||
compiling = COMPILING, dir = p.root().display()))); | ||
}) | ||
|
||
test!(dep_with_submodule { | ||
let project = project("foo"); | ||
let git_project = git_repo("dep1", |project| { | ||
project | ||
.file("Cargo.toml", r#" | ||
[package] | ||
name = "dep1" | ||
version = "0.5.0" | ||
authors = ["[email protected]"] | ||
"#) | ||
}).assert(); | ||
let git_project2 = git_repo("dep2", |project| { | ||
project | ||
.file("lib.rs", "pub fn dep() {}") | ||
}).assert(); | ||
|
||
git_project.process("git").args(["submodule", "add"]) | ||
.arg(git_project2.root()).arg("src").exec_with_output().assert(); | ||
git_project.process("git").args(["add", "."]).exec_with_output().assert(); | ||
git_project.process("git").args(["commit", "-m", "test"]).exec_with_output() | ||
.assert(); | ||
|
||
let project = project | ||
.file("Cargo.toml", format!(r#" | ||
[project] | ||
name = "foo" | ||
version = "0.5.0" | ||
authors = ["[email protected]"] | ||
[dependencies.dep1] | ||
git = 'file:{}' | ||
"#, git_project.root().display())) | ||
.file("src/lib.rs", " | ||
extern crate dep1; | ||
pub fn foo() { dep1::dep() } | ||
"); | ||
|
||
let root = project.root(); | ||
let git_root = git_project.root(); | ||
|
||
assert_that(project.cargo_process("cargo-build"), | ||
execs() | ||
.with_stdout(format!("{} git repository `file:{}`\n\ | ||
{} dep1 v0.5.0 (file:{}#[..])\n\ | ||
{} foo v0.5.0 (file:{})\n", | ||
UPDATING, git_root.display(), | ||
COMPILING, git_root.display(), | ||
COMPILING, root.display())) | ||
.with_stderr("")); | ||
}) |