From 88b25a58f0164ab609061cb20cfb83c3bcb9a9ec Mon Sep 17 00:00:00 2001 From: Christian Halstrick Date: Fri, 10 Oct 2014 00:00:45 +0200 Subject: [PATCH] When marking commits as uninteresting don't care if the tree exists 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 --- .../src/org/eclipse/jgit/revwalk/ObjectWalk.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java index ef96b77c5..b73ccb197 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java @@ -246,7 +246,11 @@ else if (o instanceof RevTree) 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