Skip to content
Snippets Groups Projects
Commit cf516c22 authored by Christophe Benz's avatar Christophe Benz
Browse files

Reimplement update_server_info to avoid error

parent 842fe5ca
No related branches found
No related tags found
No related merge requests found
Pipeline #1213 failed with stage
in 1 minute and 22 seconds
......@@ -26,6 +26,7 @@
import argparse
from collections import deque, OrderedDict
import glob
import hashlib
import io
import itertools
......@@ -42,7 +43,6 @@ from dulwich.objects import Blob, Tree, Commit
from dulwich.pack import deltify_pack_objects, load_pack_index, OFS_DELTA, REF_DELTA, SHA1Writer, write_pack_index_v2, \
write_pack_object, write_pack_header
from dulwich.repo import Repo
from dulwich.server import update_server_info
from lxml import etree
from slugify import slugify
import ujson as json
......@@ -400,7 +400,13 @@ def main():
)
log.info("Commit ID: %s", commit_id)
update_server_info(repo)
# Don't use dulwich.server.update_server_info because it triggers "Too many files open" error.
pack_dir_path = os.path.abspath(os.path.join(args.target_dir, "objects", "pack"))
packs_file_path = os.path.join(args.target_dir, "objects", "info", "packs")
with open(packs_file_path, "w") as packs_file:
for pack_file_path in glob.iglob(os.path.join(pack_dir_path, "*.pack")):
pack_file_name = os.path.basename(pack_file_path)
packs_file.write("P {}\n".format(pack_file_name))
return 0
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment