- Commit
- ac10f36302a7f23e0ddef584f8e0be2adc16eea8
- Parent
- 31b226e33acfce79acd1969a7c89adf93bd34138
- Author
- Pablo <pablo-pie@riseup.net>
- Date
Fixed a bug
Yet another static site generator for Git 🙀️
Fixed a bug
1 files changed, 11 insertions, 1 deletions
Status | Name | Changes | Insertions | Deletions |
Modified | src/main.rs | 2 files changed | 11 | 1 |
diff --git a/src/main.rs b/src/main.rs @@ -551,7 +551,7 @@ impl<'repo> RepoRenderer<'repo> { tree_stack.push((subtree, path)); } - Some(ObjectType::Commit) => { + Some(ObjectType::Commit) => if !self.repo.is_bare() { let submod = self .repo .find_submodule(&path.to_string_lossy()) @@ -571,6 +571,16 @@ impl<'repo> RepoRenderer<'repo> { path = Escaped(&path.to_string_lossy()), )?; } + } else { + // we cannot lookup a submodule in a bare repo, because the + // .gitmodules index is located in the working tree + warnln!("Cannot lookup {path:?} submodule in {repo}: {repo:?} is a bare repository.", + repo = self.name); + writeln!( + &mut f, + "<tr><td><span class=\"subtree\">{path}@</span></td></tr>", + path = Escaped(&path.to_string_lossy()), + )?; } Some(kind) => { unreachable!("unexpected tree entry kind {kind:?}")