mirror of
https://github.com/gitui-org/gitui
synced 2026-05-23 08:58:21 +00:00
Use git_message_prettify (#924)
This commit is contained in:
parent
5f34e9cc07
commit
48f9331b0d
3 changed files with 5 additions and 15 deletions
|
|
@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
## Fixed
|
||||
- appropriate error message when pulling deleted remote branch ([#911](https://github.com/extrawurst/gitui/issues/991))
|
||||
- improved color contrast in branches popup for light themes [[@Cottser](https://github.com/Cottser)] ([#922](https://github.com/extrawurst/gitui/issues/922))
|
||||
- use git_message_prettify for commit messages ([#917](https://github.com/extrawurst/gitui/issues/917))
|
||||
|
||||
## [0.17.1] - 2021-09-10
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ pub use crate::{
|
|||
},
|
||||
tags::AsyncTags,
|
||||
};
|
||||
pub use git2::message_prettify;
|
||||
use std::{
|
||||
collections::hash_map::DefaultHasher,
|
||||
hash::{Hash, Hasher},
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ use crate::{
|
|||
};
|
||||
use anyhow::Result;
|
||||
use asyncgit::{
|
||||
cached,
|
||||
cached, message_prettify,
|
||||
sync::{
|
||||
self, get_config_string, CommitId, HookResult, RepoState,
|
||||
},
|
||||
|
|
@ -149,19 +149,7 @@ impl CommitComponent {
|
|||
drop(file);
|
||||
std::fs::remove_file(&file_path)?;
|
||||
|
||||
let message: String = message
|
||||
.lines()
|
||||
.flat_map(|l| {
|
||||
if l.starts_with('#') {
|
||||
vec![]
|
||||
} else {
|
||||
vec![l, "\n"]
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
|
||||
let message = message.trim().to_string();
|
||||
|
||||
message = message_prettify(message, Some(b'#'))?;
|
||||
self.input.set_text(message);
|
||||
self.input.show()?;
|
||||
|
||||
|
|
@ -193,7 +181,7 @@ impl CommitComponent {
|
|||
)));
|
||||
return Ok(());
|
||||
}
|
||||
let mut msg = msg;
|
||||
let mut msg = message_prettify(msg, Some(b'#'))?;
|
||||
if let HookResult::NotOk(e) =
|
||||
sync::hooks_commit_msg(CWD, &mut msg)?
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue