From 55dcc17c331f580b3beeb4d5decf64d3baf94f2e Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 24 Jun 2010 16:02:28 +0200 Subject: aggressive_tree_merge: fixed incorrect handling of one branch, it was just not implemented causing incorrect merge results. Added test to cover this issue Diff: added NULL_BIN_SHA constant for completeness --- lib/git/index/base.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'lib/git/index/base.py') 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. -- cgit v1.2.1