Add simple abbreviate() method to ObjectId
commit28fc0b1682288cf18c5727bf786669531cb5439b
authorMarek Zawirski <marek.zawirski@gmail.com>
Sun, 17 Aug 2008 20:43:56 +0000 (17 22:43 +0200)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Thu, 21 Aug 2008 21:32:20 +0000 (21 23:32 +0200)
tree2341029a6618c79a8f0896a9a09e64c16e0e7d26
parentb80b86b5620e15d8cf6aa99143a06c56557b9487
Add simple abbreviate() method to ObjectId

It's common usage to search for short, but unique abbreviation of
object's SHA-1, so let's have a method for that.

This is a really workaround implementation, but it has been already used
in other places. Let's have other usages pointing here, so we can easily
change only this implementation later.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
[Amended not to break Branch command in latest master]
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Branch.java
org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Fetch.java
org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Push.java
org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/TextBuiltin.java
org.spearce.jgit/src/org/spearce/jgit/lib/AnyObjectId.java