Silently permit invalid ObjectIds during RefUpdate
commitef9d791711147217aa3f99813b20b876a3a1986f
authorShawn O. Pearce <spearce@spearce.org>
Fri, 15 Aug 2008 17:43:41 +0000 (15 10:43 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Fri, 15 Aug 2008 17:43:41 +0000 (15 10:43 -0700)
treeb9abed9458e1474ebf6b07930c4ed1a45536dbbd
parent2e1702146da802b5760acc4cdfd543e317468f2b
Silently permit invalid ObjectIds during RefUpdate

If we try to parse objects which don't exist it may be because
we are trying to force deletion of a ref exactly because the
object the ref currently refers to has been pruned from the
object database already.  Rather than fail with an exception
we should still permit the removal.

This also fixes the breakage in the unit tests introduced by
Charles' 5a318367 "Refactor of RefUpdate force ...".  One of
the unit tests for RefUpdate is using a bad ObjectId as the
new value for the ref, and uses forceUpdate to hammer it into
the ref database anyway, even though it is not valid as the
object does not exist.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.spearce.jgit/src/org/spearce/jgit/lib/RefUpdate.java