diff options
author | kballou <kballou@devnulllabs.io> | 2017-02-08 19:48:24 -0700 |
---|---|---|
committer | kballou <kballou@devnulllabs.io> | 2017-02-08 19:48:24 -0700 |
commit | 557ef577085017887cfbc8bcc8445b719a78cf95 (patch) | |
tree | 31ec88be55288a7b83e6603b7eca9188832d1914 /lib | |
parent | fefd791ed686d9dd0f5551be4c0c339b14998051 (diff) | |
download | exgit-557ef577085017887cfbc8bcc8445b719a78cf95.tar.gz exgit-557ef577085017887cfbc8bcc8445b719a78cf95.tar.xz |
WIP: initial packfile parser
Diffstat (limited to 'lib')
-rw-r--r-- | lib/exgit/packfile.ex | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/exgit/packfile.ex b/lib/exgit/packfile.ex index 4fda345..3823259 100644 --- a/lib/exgit/packfile.ex +++ b/lib/exgit/packfile.ex @@ -2,4 +2,17 @@ defmodule Exgit.Packfile do @moduledoc """ Module for parsing Git Packfiles """ + + @spec parse_header(binary) :: {:pack, 2|3, integer} + def parse_header(packfile) do + <<"PACK" :: utf8, 2 :: size(32), n :: size(32)>> <> rest = packfile + {:pack, 2, n, rest} + end + + @spec parse_objects(integer, binary) :: [{:commit|:blob|:tree, + binary, + binary}] + def parse_objects(n, pack) do + nil + end end |