From 432ac62a140cf240fc7b568e5015d086f4c087eb Mon Sep 17 00:00:00 2001 From: Gaetano Checinski Date: Sun, 3 Mar 2019 00:04:58 +0000 Subject: [PATCH] fix: fetchcommits and terminates expnential deepening if no commits fetched (#330) --- buckaroo/DefaultSourceExplorer.fs | 2 +- buckaroo/GitCli.fs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/buckaroo/DefaultSourceExplorer.fs b/buckaroo/DefaultSourceExplorer.fs index 2e772c4..4a52439 100644 --- a/buckaroo/DefaultSourceExplorer.fs +++ b/buckaroo/DefaultSourceExplorer.fs @@ -101,7 +101,7 @@ type DefaultSourceExplorer (console : ConsoleManager, downloadManager : Download match maybeBranchRef with | Some branchRef -> yield branchRef.Revision - yield! gitManager.FetchCommits url branchRef.Revision + yield! gitManager.FetchCommits url branchRef.Name () | None -> () } diff --git a/buckaroo/GitCli.fs b/buckaroo/GitCli.fs index 4bbef58..b840cdd 100644 --- a/buckaroo/GitCli.fs +++ b/buckaroo/GitCli.fs @@ -222,6 +222,7 @@ type GitCli (console : ConsoleManager) = return (skip + (nextList |> List.length), nextList, fetchNext) }) ( 0, List.empty, async { return () } ) + |> AsyncSeq.takeWhile (fun (_, revs, _) -> revs.Length > 0) |> AsyncSeq.collect (fun (_, revs, fetchNext) -> asyncSeq { yield! revs |> AsyncSeq.ofSeq do! fetchNext