mirror of
https://github.com/newren/git-filter-repo.git
synced 2024-07-06 02:12:17 +02:00
filter-repo: avoid dying with --analyze on commits with unseen parents
analyze_commit() calls add_commit_and_parents() which does a sanity check that we have seen all parents previously. --refs breaks that assumption, so we need to workaround that check when ref limiting is in effect. Signed-off-by: Elijah Newren <newren@gmail.com>
This commit is contained in:
parent
46549e7d3f
commit
fe33fc42b3
@ -2339,6 +2339,12 @@ class RepoAnalyze(object):
|
||||
filenames = [PathQuoting.dequote(x) for x in splits[1:]]
|
||||
file_changes.append([modes, shas, change_types, filenames])
|
||||
|
||||
# If someone is trying to analyze a subset of the history, make sure
|
||||
# to avoid dying on commits with parents that we haven't seen before
|
||||
if args.refs:
|
||||
graph.record_external_commits([p for p in parents
|
||||
if not p in graph.value])
|
||||
|
||||
# Analyze this commit and update progress
|
||||
RepoAnalyze.analyze_commit(stats, graph, commit, parents, date,
|
||||
file_changes)
|
||||
|
Loading…
Reference in New Issue
Block a user