summary history branches tags files
commit:6a83f74282374c7b92df03c0d8fb121d45a14293
author:Trevor Bentley
committer:Trevor Bentley
date:Sun Jan 15 02:55:47 2023 +0100
parents:19ec6e017f76e9a9949d0b2084d6da6197ae6415
fix tags missing from alt_refs
diff --git a/README.md b/README.md
line changes: +1/-0
index 82e9140..71dafa0
--- a/README.md
+++ b/README.md
@@ -175,6 +175,7 @@ Small repositories with dozens to hundreds of commits can be generated on the or
 * No permalinks.  Links to file contents are invalidated if the file changes.
 * High memory usage for large repositories.
 * Limited to the pre-defined set of input templates.
+* Leaves output in unknown, partial state in case of errors.
 
 ## Main Dependencies
 

diff --git a/src/git.rs b/src/git.rs
line changes: +5/-2
index 875b9b9..f2d4509
--- a/src/git.rs
+++ b/src/git.rs
@@ -265,10 +265,13 @@ pub fn parse_repo(
     for refr in repo.references()? {
         let refr = refr?;
         if let (Some(target), Some(name)) = (refr.target(), refr.shorthand()) {
-            let id = target.to_string();
+            let id = match refr.peel_to_tag() {
+                Ok(tag) => tag.target_id().to_string(),
+                _ => target.to_string(),
+            };
             match references.contains_key(&id) {
                 false => {
-                    references.insert(target.to_string(), vec![name.to_string()]);
+                    references.insert(id, vec![name.to_string()]);
                 }
                 true => {
                     references.get_mut(&id).unwrap().push(name.to_string());