Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Commit 001ca9f

Browse files
authored
ignore non-blob objects in git file sources (#557)
sometimes tree-like objects would enter this function, and result in their object data being read into a buffer (they are not utf8 strings); producing funny looking buffer data: 40000 ISSUE_TEMPLATEoDW$yhQ��M��\fX��V�40000 workflows�\nk��$�*^c���0N*7 inspecting the object in git shows that it is a tree and not a blob: λ git cat-file -t 3f8a07d tree λ git cat-file -p 3f8a07d 040000 tree 6f44572 ISSUE_TEMPLATE 040000 tree ee0a6b1 workflows
1 parent bf83ac5 commit 001ca9f

File tree

1 file changed

+4
-0
lines changed
  • server/bleep/src/repo/iterator

1 file changed

+4
-0
lines changed

server/bleep/src/repo/iterator/git.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ impl FileSource for GitWalker {
143143
return None;
144144
}
145145

146+
if object.kind != gix::object::Kind::Blob {
147+
return None;
148+
}
149+
146150
let buffer = String::from_utf8_lossy(&object.data).to_string();
147151

148152
Some(RepoFile {

0 commit comments

Comments
 (0)