summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2014-03-06 19:27:28 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-03-08 07:46:50 -0800
commitcc3a184adfcf08744de1caf930430300656349a2 (patch)
treec84150e3110222adcb424f50b899cdd2df4b06ca /file.c
parent6d0011947b0675de21e4010dedb14a94cd7f7873 (diff)
downloadsubsurface-cc3a184adfcf08744de1caf930430300656349a2.tar.gz
Add initial parser for git trees
It doesn't actually parse the files themselves, but it does walk the object tree and print out the dives and trips it finds. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/file.c b/file.c
index 302989408..826f3eb51 100644
--- a/file.c
+++ b/file.c
@@ -356,6 +356,10 @@ static void parse_file_buffer(const char *filename, struct memblock *mem, char *
if (!mem->size || !mem->buffer)
return;
+ if (mem->size > 3 && !memcmp(mem->buffer, "git", 3)) {
+ git_load_dives(mem->buffer);
+ return;
+ }
parse_xml_buffer(filename, mem->buffer, mem->size, &dive_table, NULL, error);
}