From 39904d6ad4c8aad79be11fff27d96b9d1698e26b Mon Sep 17 00:00:00 2001 From: Shawn Pearce Date: Thu, 3 Apr 2014 10:12:53 -0700 Subject: [PATCH] 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 --- .../src/org/eclipse/jgit/transport/PackParser.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java index 4f53d2267..c3fdacc27 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java @@ -1017,7 +1017,8 @@ public abstract class PackParser { throw new CorruptObjectException(MessageFormat.format( JGitText.get().invalidObject, Constants.typeString(type), - id.name(), e.getMessage()), e); + readCurs.abbreviate(id, 10).name(), + e.getMessage()), e); } }