Skip to content

Commit

Permalink
Respect history_pages_back when retrieving projects
Browse files Browse the repository at this point in the history
  • Loading branch information
gousiosg committed Feb 4, 2020
1 parent 5f001e5 commit 5e368c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/ghtorrent/ghtorrent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ def ensure_commits(user, repo, sha: nil, return_retrieved: false,
num_retrieved = 0
commits = ['foo'] # Dummy entry for simplifying the loop below
commit_acc = []
until commits.empty?
commit_pages = 0

until commits.empty? or commit_pages >= config(:mirror_history_pages_back)
commits = retrieve_commits(repo, sha, user, 1)
commit_pages += 1

# This means that we retrieved the last commit page again
if commits.size == 1 and commits[0]['sha'] == sha
Expand Down

0 comments on commit 5e368c6

Please sign in to comment.