History

checkout returns index checkout result (#450)

Sebastian Thiel committed 4 years ago

Commit 2ef8d531 parent 056f4dd2 files · +4 −4Browse files

Unified · Split

2 files
  1. git-repository/src/clone/checkout.rs +3 −3
  2. git-repository/tests/clone/mod.rs +1 −1
git-repository/src/clone/checkout.rs+3−3
@@ -43,7 +43,7 @@ pub mod main_worktree { · 42 unmodified lines
4343 &mut self,
4444 mut progress: impl crate::Progress,
4545 should_interrupt: &AtomicBool,
46− ) -> Result<Repository, Error> {
46+ ) -> Result<(Repository, git_worktree::index::checkout::Outcome), Error> {
4747 let repo = self
4848 .repo
4949 .as_ref()
@@ -75,7 +75,7 @@ pub mod main_worktree { · 25 unmodified lines
7575 bytes.init(None, crate::progress::bytes());
7676
7777 let start = std::time::Instant::now();
78− git_worktree::index::checkout(
78+ let outcome = git_worktree::index::checkout(
7979 &mut index,
8080 workdir,
8181 {
@@ -91,7 +91,7 @@ pub mod main_worktree { · 9 unmodified lines
9191 bytes.show_throughput(start);
9292
9393 index.write(Default::default())?;
94− Ok(self.repo.take().expect("still present"))
94+ Ok((self.repo.take().expect("still present"), outcome))
9595 }
9696 }
9797 }
git-repository/tests/clone/mod.rs+1−1
@@ -66,7 +66,7 @@ fn fetch_and_checkout() -> crate::Result { · 65 unmodified lines
6666 let (mut checkout, _out) = prepare
6767 .fetch_then_checkout(git::progress::Discard, &std::sync::atomic::AtomicBool::default())
6868 .unwrap();
69− let repo = checkout
69+ let (repo, _) = checkout
7070 .main_worktree(git::progress::Discard, &std::sync::atomic::AtomicBool::default())
7171 .unwrap();
7272