From 33ae233f240c67b30f0722dd74929144e237b845 Mon Sep 17 00:00:00 2001
From: Jonas Haag <jonas@lophus.org>
Date: Sun, 22 Jun 2014 13:13:01 +0200
Subject: [PATCH] Ignore git submodules for .tar.gz downloads

---
 klaus/tarutils.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/klaus/tarutils.py b/klaus/tarutils.py
index 3eeb2d6..ce1af42 100644
--- a/klaus/tarutils.py
+++ b/klaus/tarutils.py
@@ -52,7 +52,11 @@ def tar_stream(repo, tree, mtime, format=''):
     buf = BytesIO()
     with tarfile.open(None, "w:%s" % format, buf) as tar:
         for entry_abspath, entry in walk_tree(repo, tree):
-            blob = repo[entry.sha]
+            try:
+                blob = repo[entry.sha]
+            except KeyError:
+                # Entry probably refers to a submodule, which we don't yet support.
+                continue
             data = ListBytesIO(blob.chunked)
 
             info = tarfile.TarInfo()
-- 
GitLab