cob: Quiet warnings in release mode
We were getting warnings in release mode, since the debug code is not being run, and some vars are mutable instead of immutable. Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
This commit is contained in:
parent
cf0d55fb11
commit
329af88ca6
|
|
@ -11,7 +11,6 @@ use git_ext::Oid;
|
||||||
use git_trailers::OwnedTrailer;
|
use git_trailers::OwnedTrailer;
|
||||||
use nonempty::NonEmpty;
|
use nonempty::NonEmpty;
|
||||||
|
|
||||||
use crate::git;
|
|
||||||
use crate::history::entry::Timestamp;
|
use crate::history::entry::Timestamp;
|
||||||
use crate::{
|
use crate::{
|
||||||
change::{self, store, Change},
|
change::{self, store, Change},
|
||||||
|
|
@ -228,28 +227,36 @@ where
|
||||||
O: AsRef<git2::Oid>,
|
O: AsRef<git2::Oid>,
|
||||||
{
|
{
|
||||||
let resource = *resource.as_ref();
|
let resource = *resource.as_ref();
|
||||||
|
let parents = tips
|
||||||
let mut parents = tips.iter().map(|o| *o.as_ref()).collect::<Vec<_>>();
|
.iter()
|
||||||
parents.push(resource);
|
.map(|o| *o.as_ref())
|
||||||
|
.chain(std::iter::once(resource))
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
let trailers: Vec<OwnedTrailer> = vec![trailers::ResourceCommitTrailer::from(resource).into()];
|
let trailers: Vec<OwnedTrailer> = vec![trailers::ResourceCommitTrailer::from(resource).into()];
|
||||||
|
|
||||||
{
|
{
|
||||||
let author = repo.signature()?;
|
let author = repo.signature()?;
|
||||||
let mut timestamp = author.when().seconds();
|
let timestamp = author.when().seconds();
|
||||||
|
|
||||||
let mut headers = commit::Headers::new();
|
let mut headers = commit::Headers::new();
|
||||||
headers.push(
|
headers.push(
|
||||||
"gpgsig",
|
"gpgsig",
|
||||||
&String::from_utf8(crypto::ssh::ExtendedSignature::from(signature).to_armored())?,
|
&String::from_utf8(crypto::ssh::ExtendedSignature::from(signature).to_armored())?,
|
||||||
);
|
);
|
||||||
let mut author = commit::Author::try_from(&author)?;
|
let author = commit::Author::try_from(&author)?;
|
||||||
|
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
if let Ok(s) = std::env::var(git::RAD_COMMIT_TIME) {
|
let (author, timestamp) = if let Ok(s) = std::env::var(crate::git::RAD_COMMIT_TIME) {
|
||||||
timestamp = s.trim().parse::<i64>().unwrap();
|
let timestamp = s.trim().parse::<i64>().unwrap();
|
||||||
author.time = git_commit::author::Time::new(timestamp, 0);
|
let author = commit::Author {
|
||||||
}
|
time: git_commit::author::Time::new(timestamp, 0),
|
||||||
|
..author
|
||||||
|
};
|
||||||
|
(author, timestamp)
|
||||||
|
} else {
|
||||||
|
(author, timestamp)
|
||||||
|
};
|
||||||
|
|
||||||
let oid = Commit::new(
|
let oid = Commit::new(
|
||||||
tree.id(),
|
tree.id(),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue