forked from adamm/git-importer
Keep a reference to the database in DBRevision
To avoid passing the db to all actions
This commit is contained in:
@@ -120,19 +120,19 @@ class GitExporter:
|
||||
self.git.gc()
|
||||
gc_cnt = self.gc_interval
|
||||
logging.debug(f"Committing {flat}")
|
||||
self.commit_flat(db, flat, branch_state)
|
||||
self.commit_flat(flat, branch_state)
|
||||
|
||||
def limit_download(self, file: Path):
|
||||
return file.suffix in (".spec", ".changes")
|
||||
|
||||
def commit_flat(self, db, flat, branch_state):
|
||||
def commit_flat(self, flat, branch_state):
|
||||
parents = []
|
||||
self.git.checkout(flat.branch)
|
||||
if flat.parent1:
|
||||
parents.append(flat.parent1.git_commit)
|
||||
if flat.parent2:
|
||||
parents.append(flat.parent2.git_commit)
|
||||
to_download, to_delete = flat.commit.calc_delta(db, branch_state[flat.branch])
|
||||
to_download, to_delete = flat.commit.calc_delta(branch_state[flat.branch])
|
||||
for file in to_delete:
|
||||
if not self.limit_download(file):
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user