|
@ -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", "target", "rev-list", "-1", "HEAD"],
|
|
|
|
|
|
|
|
|
["-C", ".", "fetch", "source", "branch"],
|
|
|
|
|
|
["-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);
|
|
|