summaryrefslogtreecommitdiff
path: root/lib/git/index/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/git/index/base.py')
-rw-r--r--lib/git/index/base.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/git/index/base.py b/lib/git/index/base.py
index 771f1710..7568b476 100644
--- a/lib/git/index/base.py
+++ b/lib/git/index/base.py
@@ -530,9 +530,7 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable):
:raise ValueError: if there are no entries in the cache
:raise UnmergedEntriesError: """
# we obtain no lock as we just flush our contents to disk as tree
- if not self.entries:
- raise ValueError("Cannot write empty index")
-
+ # If we are a new index, the entries access will load our data accordingly
mdb = MemoryDB()
entries = self._entries_sorted()
binsha, tree_items = write_tree_from_cache(entries, mdb, slice(0, len(entries)))
@@ -892,7 +890,6 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable):
return out
- @default_index
def commit(self, message, parent_commits=None, head=True):
"""
Commit the current default index file, creating a commit object.