Skip to content

Instantly share code, notes, and snippets.

@robertpi robertpi/unfold.fsx
Created Oct 15, 2015

Embed
What would you like to do?
let walkCommits (hash: Hash, count) =
printfn "%s %s %s" objectsDir hash.DirectoryName hash.FileName
let objectPath = Path.Combine(objectsDir, hash.DirectoryName, hash.FileName)
printfn "objectPath: %s" objectPath
let gitObject = GitObject.ParseFile objectPath
match gitObject with
| Commit (_, commit) ->
match commit.Parent with
| Some (hash) when count < 10 ->
Some(commit, (hash, (count + 1)))
| Some (_)
| None -> None
| _ -> failwithf "Unexpected object type: %A" gitObject
Seq.unfold walkCommits (headHash, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.