summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/repository/git.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/models/repository/git.rb b/app/models/repository/git.rb
index 207a224ec..869138ee7 100644
--- a/app/models/repository/git.rb
+++ b/app/models/repository/git.rb
@@ -162,10 +162,12 @@ class Repository::Git < Repository
opts[:excludes] = prev_db_heads
opts[:includes] = repo_heads
begin
+ cnt = 0
scm.revisions('', nil, nil, opts) do |rev|
+ cnt += 1
db_rev = find_changeset_by_name(rev.scmid)
- transaction do
- if db_rev.nil?
+ if db_rev.nil?
+ transaction do
db_saved_rev = save_revision(rev)
parents = {}
parents[db_saved_rev] = rev.parents unless rev.parents.nil?
@@ -173,6 +175,9 @@ class Repository::Git < Repository
ch.parents = chparents.collect{|rp| find_changeset_by_name(rp)}.compact
end
end
+ end
+ if cnt > 100
+ cnt = 0
h["heads"] = prev_db_heads.dup
h["heads"] << rev.scmid
merge_extra_info(h)