Abbreviate SHA-1s when reporting invalid objects

The full 40 digit name is rather long. In most cases an abbreviated
name should be sufficient.

Change-Id: Id16a37c6c745ede1fa0d97c5bc390491799500bc
This commit is contained in:
Shawn Pearce 2014-04-03 10:12:53 -07:00
parent 8924d4e0a0
commit 39904d6ad4
1 changed files with 2 additions and 1 deletions

View File

@ -1017,7 +1017,8 @@ private void verifySafeObject(final AnyObjectId id, final int type,
throw new CorruptObjectException(MessageFormat.format(
JGitText.get().invalidObject,
Constants.typeString(type),
id.name(), e.getMessage()), e);
readCurs.abbreviate(id, 10).name(),
e.getMessage()), e);
}
}