summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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>(