Fix unisolated git checkout test

This depends on the target dir to exist; `target` does exist unless
a different build dir is used.
This commit is contained in:
Adrian Heine 2023-02-24 18:05:48 +01:00
parent e569bdb416
commit dd7c6c10fd

View file

@ -132,7 +132,7 @@ mod test {
args: RefCell::new(vec![]), args: RefCell::new(vec![]),
}; };
let checkout: Checkout<DummyCommandRunner, _, _, _, _> = let checkout: Checkout<DummyCommandRunner, _, _, _, _> =
Checkout::new("target", "source", "branch", &c); Checkout::new(".", "source", "branch", &c);
let start = Instant::now(); let start = Instant::now();
assert!(run(checkout.target_reached()).unwrap()); assert!(run(checkout.target_reached()).unwrap());
let end = Instant::now(); let end = Instant::now();
@ -142,11 +142,11 @@ mod test {
assert_eq!( assert_eq!(
first_two_args, first_two_args,
[ [
["-C", "target", "fetch", "source", "branch"], ["-C", ".", "fetch", "source", "branch"],
["-C", "target", "rev-list", "-1", "HEAD"], ["-C", ".", "rev-list", "-1", "HEAD"],
] ]
); );
assert_eq!(args[2], ["-C", "target", "rev-list", "-1", "FETCH_HEAD"]); assert_eq!(args[2], ["-C", ".", "rev-list", "-1", "FETCH_HEAD"]);
assert!((end - start).as_millis() >= 100); assert!((end - start).as_millis() >= 100);
assert!((end - start).as_millis() < 150); assert!((end - start).as_millis() < 150);