Don't treat head as special in changelog

The changelog is no longer comitted, so we no longer need to avoid
including the commit hash.

type: documentation
This commit is contained in:
Casey Rodarmor 2020-09-06 23:21:01 -07:00
parent 2d226cf016
commit 39dcb5e183
No known key found for this signature in database
GPG Key ID: 556186B153EC6FE0
2 changed files with 2 additions and 13 deletions

View File

@ -13,8 +13,6 @@ impl Changelog {
let mut entries = Vec::new();
let mut head = true;
loop {
let summary_bytes = current
.summary_bytes()
@ -37,15 +35,12 @@ impl Changelog {
let entry = Entry::new(
&current,
manifest.package.unwrap().version.as_ref(),
head,
&project.config,
)?;
entries.push(entry);
}
head = false;
match current.parent_count() {
0 => break,
1 => current = current.parent(0)?,

View File

@ -7,12 +7,11 @@ pub(crate) struct Entry {
hash: String,
author: String,
summary: String,
head: bool,
}
impl Entry {
#[throws]
pub(crate) fn new(commit: &Commit, version: &str, head: bool, config: &Config) -> Self {
pub(crate) fn new(commit: &Commit, version: &str, config: &Config) -> Self {
let time = DateTime::<Utc>::from_utc(
NaiveDateTime::from_timestamp(commit.time().seconds(), 0),
Utc,
@ -48,18 +47,13 @@ impl Entry {
summary: commit.summary().unwrap().into(),
version: version.into(),
author,
head,
metadata,
time,
}
}
fn url(&self) -> String {
if self.head {
"https://github.com/casey/intermodal/commits/master".into()
} else {
format!("https://github.com/casey/intermodal/commit/{}", self.hash)
}
format!("https://github.com/casey/intermodal/commit/{}", self.hash)
}
fn shorthash(&self) -> String {