Handbook
Glossary
parse-object ( bytes -- git-obj )
Vocabulary
git
Inputs
bytes
an
object
Outputs
git-obj
an
object
Definition
USING:
combinators
io
io.encodings.utf8
io.streams.byte-array
kernel
math.parser
splitting
;
IN:
git
:
parse-object
( bytes -- git-obj )
utf8
[
{
0
}
read-until
0
=
drop
dup
" "
split1
drop
{
{
"blob"
[
"unimplemented blob parsing"
throw
]
}
{
"commit"
[
" "
split1
[
"commit"
assert=
]
[
string>number
read
]
bi*
commit
parse-new-git-object
]
}
{
"tree"
[
tree
parse-new-git-object
]
}
[
unknown-git-object
]
}
case
]
with-byte-reader
;