Skip to content

Commit af3608a

Browse files
committed
adapt to changes in gix
1 parent ab25a3a commit af3608a

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

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

+6-5
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ pub fn collect(repo: &gix::Repository) -> anyhow::Result<Option<commit::History>
4343
.id()
4444
.ancestors()
4545
.sorting(gix::traverse::commit::Sorting::ByCommitTimeNewestFirst)
46+
.use_commit_graph(false)
4647
.all()?
4748
{
48-
let commit_id = commit_id?;
49+
let commit = commit_id?;
4950
let (message, tree_id, parent_tree_id, commit_time) = {
5051
let (message, tree_id, commit_time, parent_commit_id) = {
51-
let object = commit_id.object()?;
52-
let commit = object.to_commit_ref();
52+
let object = commit.object()?;
53+
let commit = object.decode()?;
5354
let parent = commit.parents().next();
5455
(commit.message.to_vec(), commit.tree(), commit.committer.time, parent)
5556
};
@@ -65,7 +66,7 @@ pub fn collect(repo: &gix::Repository) -> anyhow::Result<Option<commit::History>
6566
Err(_) => {
6667
log::warn!(
6768
"Commit message of {} could not be decoded to UTF-8 - ignored",
68-
commit_id.as_ref()
69+
commit.id
6970
);
7071
continue;
7172
}
@@ -76,7 +77,7 @@ pub fn collect(repo: &gix::Repository) -> anyhow::Result<Option<commit::History>
7677
data_by_tree_id.insert(tree_id, handle.find_object(tree_id)?.data.to_owned());
7778
}
7879
items.push(commit::history::Item {
79-
id: commit_id.detach(),
80+
id: commit.id,
8081
commit_time,
8182
message: commit::Message::from(message),
8283
tree_id,

gitoxide-core/src/repository/revision/list.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub fn list(
2727
.id
2828
.attach(&repo);
2929
for commit in commit_id.ancestors().all()? {
30-
writeln!(out, "{}", commit?.to_hex())?;
30+
writeln!(out, "{}", commit?.id().to_hex())?;
3131
}
3232
Ok(())
3333
}

gix/src/revision/walk.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ pub enum Error {
1919
pub struct Info<'repo> {
2020
/// The detached id of the commit.
2121
pub id: gix_hash::ObjectId,
22-
/// All parent ids we have encountered. Note that these will be at most one if [`Parents::First`] is enabled.
22+
/// All parent ids we have encountered. Note that these will be at most one if [`Parents::First`][gix_traverse::commit::Parents::First] is enabled.
2323
pub parent_ids: gix_traverse::commit::ParentIds,
24-
/// The time at which the commit was created. It's only `Some(_)` if sorting is not [`Sorting::BreadthFirst`], as the walk
25-
/// needs to require the commit-date.
24+
/// The time at which the commit was created. It's only `Some(_)` if sorting is not [`Sorting::BreadthFirst`][gix_traverse::commit::Sorting::BreadthFirst],
25+
/// as the walk needs to require the commit-date.
2626
pub commit_time: Option<u64>,
2727

2828
repo: &'repo Repository,

0 commit comments

Comments
 (0)