]> source.dussan.org Git - jgit.git/commitdiff
When marking commits as uninteresting don't care if the tree exists 27/34727/1
authorChristian Halstrick <christian.halstrick@sap.com>
Thu, 9 Oct 2014 22:00:45 +0000 (00:00 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Fri, 10 Oct 2014 14:52:43 +0000 (10:52 -0400)
When during an ObjectWalk commits are marked as uninteresting we should
be tolerant against the situation that the commit exists in the repo but
the referenced tree is not exisiting. Since commit
c4797fe98655b3d52d0a90ba44fce6e053db3b8b we are throwing
MissingObjectException in such a case. This semantic differs from native
git behaviour and may cause push operations to fail while they would
work in native git. See:
http://dev.eclipse.org/mhonarc/lists/egit-dev/msg03585.html

Bug: 445744
Change-Id: Ib7dec10fd2ef1adbb8adbabb9d3d5a64e554286a

org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java

index ef96b77c5f6dec1ca55a6885053e4f0c8cf916ce..b73ccb197482e3352615881932df77ba9d0d6348 100644 (file)
@@ -246,7 +246,11 @@ public class ObjectWalk extends RevWalk {
        public void markUninteresting(RevCommit c) throws MissingObjectException,
                        IncorrectObjectTypeException, IOException {
                super.markUninteresting(c);
-               markTreeUninteresting(c.getTree());
+               try {
+                       markTreeUninteresting(c.getTree());
+               } catch (MissingObjectException e) {
+                       // we don't care if the tree of the commit does not exist locally
+               }
        }
 
        @Override