From: Frantisek Hrbata Date: Sun, 27 Dec 2020 11:25:51 +0000 (+0100) Subject: mrlib: ignore batch separator line from git-cat-file X-Git-Tag: v0.3~6 X-Git-Url: http://www.hrbata.com/gitweb/?a=commitdiff_plain;h=106c5af97f3d9e7f21f41b3de679704f28943a8a;p=gimrr.git mrlib: ignore batch separator line from git-cat-file Signed-off-by: Frantisek Hrbata --- diff --git a/mrlib.py b/mrlib.py index 2349533..cf2a2fb 100755 --- a/mrlib.py +++ b/mrlib.py @@ -262,6 +262,8 @@ def load_tags(mrs, refs=None, users=None, commits=True, squash=False): rv, out, err = run(["git", "cat-file", "--batch"], stdin=stdin) + batch_re = re.compile("[0-9a-f]{40}\s+blob") + mr = None user = None commit = None @@ -269,6 +271,10 @@ def load_tags(mrs, refs=None, users=None, commits=True, squash=False): if not line: continue + match = batch_re.match(line) + if match: + continue + tag, value = line.split(None, 1) if tag == "@m": mr = value