Patch #22798

fetching of Git changesets sometimes fails due to non existant revisions in prev_db_heads

Added by Jens Krämer 12 months ago. Updated 11 months ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:SCM
Target version:Candidate for next minor release

Description

Under certain circumstances it may happen that revisions disappear from a git repository (i.e. when the repository is compacted / garbage collected after doing force pushes).

Redmine stores a prev_db_heads list in the repositories extra_info, which may contain hashes pointing to such no more existing objects. In this case, Repository#fetch_changesets will fail silently and not fetch anything, since the underlying git log command refuses to work when non existing revisions are given on the command line.

The attached patch was extracted from Planio and checks each entry in prev_db_heads, keeping only those that still exist.

0001-filter-list-of-previous-git-heads-to-exclude-those-t.patch Magnifier (1.41 KB) Jens Krämer, 2016-05-12 02:37

History

#1 Updated by Jan from Planio www.plan.io 12 months ago

  • Target version set to Candidate for next minor release

#2 Updated by Go MAEDA 11 months ago

  • Target version deleted (Candidate for next minor release)

Thanks for the patch. But a test fails in my environment.

$ ruby test/unit/repository_git_test.rb
(snip)

# Running:

..............F...........

Finished in 12.697746s, 2.0476 runs/s, 13.6245 assertions/s.

  1) Failure:
RepositoryGitTest#test_fetch_changesets_history_editing [test/unit/repository_git_test.rb:241]:
Expected: 23
  Actual: 29

26 runs, 173 assertions, 1 failures, 0 errors, 0 skips

#3 Updated by Go MAEDA 11 months ago

  • Target version set to Candidate for next minor release

Also available in: Atom PDF