Vote #77437
未完了fetching of Git changesets sometimes fails due to non existant revisions in prev_db_heads
0%
説明
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":https://plan.io/redmine-hosting and checks each entry in @prev_db_heads@, keeping only those that still exist.
journals
--------------------------------------------------------------------------------
Thanks for the patch. But a test fails in my environment.
<pre>
$ 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
</pre>
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Admin Redmine さんがほぼ2年前に更新
- カテゴリ を SCM_3 にセット
- 対象バージョン を Candidate for next minor release_33 にセット