mrlib: ignore batch separator line from git-cat-file
authorFrantisek Hrbata <frantisek@hrbata.com>
Sun, 27 Dec 2020 11:25:51 +0000 (12:25 +0100)
committerFrantisek Hrbata <frantisek@hrbata.com>
Sun, 27 Dec 2020 11:25:51 +0000 (12:25 +0100)
Signed-off-by: Frantisek Hrbata <frantisek@hrbata.com>
mrlib.py

index 234953385069e79784c69918d7cc796ed9647138..cf2a2fb0c50e67545d437e53952e1f0406da1729 100755 (executable)
--- 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