Skip to content

Commit dae710f

Browse files
committed
minor refactor
1 parent 0fb4c91 commit dae710f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cargo-smart-release/src/git/history.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ pub enum SegmentScope {
2929
}
3030

3131
pub fn collect(handle: &git::easy::Handle) -> anyhow::Result<Option<commit::History>> {
32-
let mut repo = handle.clone();
33-
repo.object_cache_size(64 * 1024);
34-
let reference = match repo.head()?.peeled()?.kind {
32+
let mut handle = handle.clone();
33+
handle.object_cache_size(64 * 1024);
34+
let reference = match handle.head()?.peeled()?.kind {
3535
head::Kind::Detached { .. } => bail!("Refusing to operate on a detached head."),
3636
head::Kind::Unborn { .. } => return Ok(None),
37-
head::Kind::Symbolic(r) => r.attach(&repo),
37+
head::Kind::Symbolic(r) => r.attach(&handle),
3838
};
3939

4040
let mut items = Vec::new();
@@ -60,7 +60,7 @@ pub fn collect(handle: &git::easy::Handle) -> anyhow::Result<Option<commit::Hist
6060
(
6161
message,
6262
tree_id,
63-
parent_commit_id.map(|id| id.attach(&repo).object().expect("present").to_commit_ref().tree()),
63+
parent_commit_id.map(|id| id.attach(&handle).object().expect("present").to_commit_ref().tree()),
6464
commit_time,
6565
)
6666
};
@@ -75,9 +75,9 @@ pub fn collect(handle: &git::easy::Handle) -> anyhow::Result<Option<commit::Hist
7575
}
7676
Ok(m) => m,
7777
};
78-
data_by_tree_id.insert(tree_id, repo.find_object(tree_id)?.data.to_owned());
78+
data_by_tree_id.insert(tree_id, handle.find_object(tree_id)?.data.to_owned());
7979
if let Some(tree_id) = parent_tree_id {
80-
data_by_tree_id.insert(tree_id, repo.find_object(tree_id)?.data.to_owned());
80+
data_by_tree_id.insert(tree_id, handle.find_object(tree_id)?.data.to_owned());
8181
}
8282
items.push(commit::history::Item {
8383
id: commit_id.detach(),

0 commit comments

Comments
 (0)