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
43 &mut self,43 &mut self,
44 mut progress: impl crate::Progress,44 mut progress: impl crate::Progress,
45 should_interrupt: &AtomicBool,45 should_interrupt: &AtomicBool,
46 ) -> Result<Repository, Error> {46 ) -> Result<(Repository, git_worktree::index::checkout::Outcome), Error> {
47 let repo = self47 let repo = self
48 .repo48 .repo
49 .as_ref()49 .as_ref()
@@ -75,7 +75,7 @@ pub mod main_worktree { · 25 unmodified lines
75 bytes.init(None, crate::progress::bytes());75 bytes.init(None, crate::progress::bytes());
76 76
77 let start = std::time::Instant::now();77 let start = std::time::Instant::now();
78 git_worktree::index::checkout(78 let outcome = git_worktree::index::checkout(
79 &mut index,79 &mut index,
80 workdir,80 workdir,
81 {81 {
@@ -91,7 +91,7 @@ pub mod main_worktree { · 9 unmodified lines
91 bytes.show_throughput(start);91 bytes.show_throughput(start);
92 92
93 index.write(Default::default())?;93 index.write(Default::default())?;
94 Ok(self.repo.take().expect("still present"))94 Ok((self.repo.take().expect("still present"), outcome))
95 }95 }
96 }96 }
97}97}
git-repository/tests/clone/mod.rs+1−1
@@ -66,7 +66,7 @@ fn fetch_and_checkout() -> crate::Result { · 65 unmodified lines
66 let (mut checkout, _out) = prepare66 let (mut checkout, _out) = prepare
67 .fetch_then_checkout(git::progress::Discard, &std::sync::atomic::AtomicBool::default())67 .fetch_then_checkout(git::progress::Discard, &std::sync::atomic::AtomicBool::default())
68 .unwrap();68 .unwrap();
69 let repo = checkout69 let (repo, _) = checkout
70 .main_worktree(git::progress::Discard, &std::sync::atomic::AtomicBool::default())70 .main_worktree(git::progress::Discard, &std::sync::atomic::AtomicBool::default())
71 .unwrap();71 .unwrap();
72 72