]> git.proxmox.com Git - cargo.git/commitdiff
Fix running tests using git on systems with customized git templates
authorBjörn Steinbrink <steinbrink@saltation.de>
Tue, 5 Aug 2014 10:24:17 +0000 (12:24 +0200)
committerBjörn Steinbrink <steinbrink@saltation.de>
Tue, 5 Aug 2014 10:27:51 +0000 (12:27 +0200)
I customized my git repo template to default to the standard pre-commit
hook that checks for e.g. trailing whitespace and refuses to commit if
any trailing whitespace was found. This causes some of cargo's tests to
fail.

To be independent of the user's git template, create the repo for the
test without using any, by specifying an empty template.

tests/test_cargo_compile_git_deps.rs

index 3afbfe366c1a862bea5a5e58ef22f599149a9efc..0aea6702cc5c6d66b2669d049e81145ced977ddc 100644 (file)
@@ -30,7 +30,7 @@ fn git_repo(name: &str, callback: |ProjectBuilder| -> ProjectBuilder)
     git_project.build();
 
     log!(5, "git init");
-    try!(git_project.process("git").args(["init"]).exec_with_output());
+    try!(git_project.process("git").args(["init", "--template="]).exec_with_output());
     log!(5, "building git project");
     log!(5, "git add .");
     try!(git_project.process("git").args(["add", "."]).exec_with_output());