Skip to content

Commit

Permalink
Fix displayed commit messages
Browse files Browse the repository at this point in the history
  • Loading branch information
francesca64 committed Dec 8, 2021
1 parent 8a0ccfe commit 8d84308
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 32 deletions.
33 changes: 6 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ lexical-core = "0.7.6"

[build-dependencies]
bicycle = { git = "https://github.com/BrainiumLLC/bicycle", rev = "28080e0c6fa4067d9dd1b0f2b7322b6b32178e1f" }
hit = "0.1.0"
hit = "0.2.0"
home = "0.5.3"
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn main() {
std::fs::create_dir_all(&install_dir).expect("failed to create install dir");

// Copy version info
match Repo::from_path(&manifest_dir).latest_message() {
match Repo::from_path(&manifest_dir).latest_subject() {
Ok(msg) => {
if let Err(err) = std::fs::write(install_dir.join("commit"), msg) {
println!(
Expand Down
2 changes: 1 addition & 1 deletion src/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pub fn update(wrapper: &TextWrapper) -> Result<(), Error> {
"`cargo-mobile` is already up-to-date"
};
let details = util::unwrap_either(
repo.latest_message()
repo.latest_subject()
.map(util::format_commit_msg)
.map_err(|err| format!("But we failed to get the latest commit message: {}", err)),
);
Expand Down
4 changes: 2 additions & 2 deletions src/util/git/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ impl Repo {
Ok(status)
}

pub fn latest_message(&self) -> Result<String, Error> {
pub fn latest_subject(&self) -> Result<String, Error> {
self.git()
.command_parse("log -1 --pretty=%B")
.command_parse("log -1 --pretty=%s")
.run_and_wait_for_str(|s| s.trim().to_owned())
.map_err(Error::LogFailed)
}
Expand Down

0 comments on commit 8d84308

Please sign in to comment.