summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Otto <th1000s@posteo.net>2024-12-09 23:09:29 +0100
committerThomas Otto <th1000s@posteo.net>2024-12-10 00:04:05 +0100
commitef3e1be569bf076f035327342939bd9d7c8908bd (patch)
tree296b681c81e4756359d7e48588ceab4d5f63e4ff
parent440cdd35dcdab4dc6c00231935411910be628983 (diff)
hyperlink commit hashes of length 7 as well
-rw-r--r--src/features/hyperlinks.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/features/hyperlinks.rs b/src/features/hyperlinks.rs
index 22ed273..102e68b 100644
--- a/src/features/hyperlinks.rs
+++ b/src/features/hyperlinks.rs
@@ -32,8 +32,10 @@ pub fn remote_from_config(cfg: &Option<&GitConfig>) -> Option<GitRemoteRepo> {
}
lazy_static! {
- // note: pure numbers are filtered out later again
- static ref COMMIT_HASH_REGEX: Regex = Regex::new(r"\b[0-9a-f]{8,40}\b").unwrap();
+ // Commit hashes can be abbreviated to 7 characters, these necessarily become longer
+ // when more objects are in a repository.
+ // Note: pure numbers are filtered out later again.
+ static ref COMMIT_HASH_REGEX: Regex = Regex::new(r"\b[0-9a-f]{7,40}\b").unwrap();
}
pub fn format_commit_line_with_osc8_commit_hyperlink<'a>(