Created
October 15, 2015 09:07
-
-
Save robertpi/ca439deebf3149eb6b0d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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