Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,23 @@ impl Repository {

let commit_content_str = std::str::from_utf8(&commit_content)?.to_string();

self
let oid = self
.inner
.commit_signed(&commit_content_str, &signature_str, signature_field.as_deref())?
.commit_signed(&commit_content_str, &signature_str, signature_field.as_deref())?;

// commit_signed only writes the object; honor update_ref like the unsigned path.
if let Some(name) = update_ref.as_deref() {
match self.inner.find_reference(name) {
Ok(mut reference) => {
reference.set_target(oid, "commit (signed)")?;
}
Err(_) => {
self.inner.reference(name, oid, true, "commit (signed)")?;
}
}
}

oid
} else {
self.inner.commit(
update_ref.as_deref(),
Expand Down