Unified · Split
| @@ -83,37 +83,32 @@ pub fn checkout_exclusive( · 82 unmodified lines | ||
| 83 | 83 | files_updated, |
| 84 | 84 | bytes_written, |
| 85 | 85 | } = match repo { |
| 86 | − Some(repo) => { | |
| 87 | − let git_dir = repo.git_dir().to_owned(); | |
| 88 | − git::worktree::index::checkout( | |
| 89 | − &mut index, | |
| 90 | − dest_directory, | |
| 91 | − git_dir, | |
| 92 | − { | |
| 93 | − let objects = repo.objects.into_arc()?; | |
| 94 | − move |oid, buf| { | |
| 95 | − objects.find_blob(oid, buf).ok(); | |
| 96 | − if empty_files { | |
| 97 | − // We always want to query the ODB here… | |
| 98 | − objects.find_blob(oid, buf)?; | |
| 99 | − buf.clear(); | |
| 100 | − // …but write nothing | |
| 101 | − Ok(git::objs::BlobRef { data: buf }) | |
| 102 | − } else { | |
| 103 | − objects.find_blob(oid, buf) | |
| 104 | − } | |
| 86 | + Some(repo) => git::worktree::index::checkout( | |
| 87 | + &mut index, | |
| 88 | + dest_directory, | |
| 89 | + { | |
| 90 | + let objects = repo.objects.into_arc()?; | |
| 91 | + move |oid, buf| { | |
| 92 | + objects.find_blob(oid, buf).ok(); | |
| 93 | + if empty_files { | |
| 94 | + // We always want to query the ODB here… | |
| 95 | + objects.find_blob(oid, buf)?; | |
| 96 | + buf.clear(); | |
| 97 | + // …but write nothing | |
| 98 | + Ok(git::objs::BlobRef { data: buf }) | |
| 99 | + } else { | |
| 100 | + objects.find_blob(oid, buf) | |
| 105 | 101 | } |
| 106 | − }, | |
| 107 | − &mut files, | |
| 108 | − &mut bytes, | |
| 109 | − should_interrupt, | |
| 110 | − opts, | |
| 111 | − ) | |
| 112 | − } | |
| 102 | + } | |
| 103 | + }, | |
| 104 | + &mut files, | |
| 105 | + &mut bytes, | |
| 106 | + should_interrupt, | |
| 107 | + opts, | |
| 108 | + ), | |
| 113 | 109 | None => git::worktree::index::checkout( |
| 114 | 110 | &mut index, |
| 115 | 111 | dest_directory, |
| 116 | − dest_directory, | |
| 117 | 112 | |_, buf| { |
| 118 | 113 | buf.clear(); |
| 119 | 114 | Ok(git::objs::BlobRef { data: buf }) |