Skip to content Skip to sidebar Skip to footer

How To Get A List Of Ostream Or Oinfo In A Variable From A Repository Path In Gitpython?

I currently have a valid git database with no packfile, but due to a bug ingit-pack-objects(the process crashes with a stack dump file) I’m unable to perform thegit repackcommand

Solution 1:

Solved!

#/usr/bin/python
import os,sys,zlib,gitdb
from gitdb.db import LooseObjectDB
from gitdb.pack import PackEntity
from gitdb.util import bin_to_hex,hex_to_bin

ldb=LooseObjectDB(sys.argv[1]+'/.git/objects')
PackEntity.create((ldb.stream(sha) for sha in ldb.sha_iter()),sys.argv[1]+'/.git/objects/pack',object_count=ldb.size(),zlib_compression=zlib.Z_BEST_COMPRESSION)

Post a Comment for "How To Get A List Of Ostream Or Oinfo In A Variable From A Repository Path In Gitpython?"