]> source.dussan.org Git - jgit.git/commit
Optimize MergeAlgorithm if ours or theirs is empty 10/3410/3
authorChristian Halstrick <christian.halstrick@sap.com>
Tue, 17 May 2011 08:59:17 +0000 (10:59 +0200)
committerChristian Halstrick <christian.halstrick@sap.com>
Tue, 17 May 2011 08:59:17 +0000 (10:59 +0200)
commit0461ff4f0c7ef505c818dac95286fa852f16eef7
tree05630af9e3e5f4d88bf82aa30e8bb62f6a0d765f
parent4e7c2f807dea99dfa968d42f221921fc79e41526
Optimize MergeAlgorithm if ours or theirs is empty

Previously when merging two contents with a non-empty base and one of
the contents was empty (size == 0) and the other was modified there
was a potentially expensive calculation until we finally always come
to the same result -> the complete non-deleted content should collide
with the empty content.

This proposal adds an optimization to detect empty input content and
to produce the appropriate result immediatly.

Change-Id: Ie6a837260c19d808f0e99173f570ff96dd22acd3
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeAlgorithmTest.java
org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeAlgorithm.java