Fix DiffFormatter NPEs for DiffEntry without content change

DiffEntry.getOldId() returns null for a diff without an index line (e.g.
only mode changed, rename without content change).

Bug: 407743
Change-Id: I42eac87421f2a53c985af260a253338f578492bc
Merge "Fix DiffFormatter NPEs for DiffEntry without content change" into stable-3.0
Fix BatchRefUpdate progress-monitoring so it doesn't count twice

I was seeing output like this while running The BFG:

Updating references:    200% (374/187)

...issue sneaked in with 5cf53fda I think.

The update call is also moved to the end of the loop, as update() is
only supposed to be called after work has been done ("Denote that some
work units have been completed").

Change-Id: I1620fa75be16dc80df44745d0e123ea512762e31
Signed-off-by: Robin Stocker <robin@nibor.org>
Harmony just doesn't have the system.console() method - default to AWT
Workaround for http://code.google.com/p/support/issues/detail?id=5576
Add pluggable inflater factory, allow setting a Harmony-friendly inflater

Under Harmony, the Inflator.inflate() method would return immediately
without examining the stream if you ask for zero-bytes of data.

This means finished() would never return true if you are naively trying to
inflate a zero-length file into a zero-length array....

....consequently jgit unpacking a zero-length file blob would blow up with:

"fatal: Packfile corruption detected: Unknown zlib error."
Fix for broken Android implementation of InflaterInputStream.close()

This fix is a bit of a hack - low-impact, but also fixing the problem in
the 'wrong' place, ie the Inflaters used by the InflaterCache- really,
should be fixing the implementation of InflaterInputStream. On Android
InflaterInputStream always ends() the Inflater it was using when closed,
even if the Inflater was not internally constructed ut supplied in the
constructor - in Oracle Java externally-provided Inflaters are NOT ended.

See https://github.com/rtyley/agit/issues/47 for more details.
Cope with malformed RefSpecs introduced by #402031

Both the source and destination in the refspec are now normalised to
remove superfluous slash ('/') characters. The normalisation performed
is the same as C-Git git-check-ref-format:

http://git-scm.com/docs/git-check-ref-format#_options

This copes with the corrupt fetch refspecs generated by JGit
v1.0-v2.3.1 for bare-repo clones. From JGit v2.1 onwards (commit
3da13473), these malformed refspecs were no longer tolerated and would
stop fetches from updating refs. Normalising the refspecs fixes this
issue and allows fetches to update refs successfully.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=402031

Change-Id: Ifd1e67fd4b52bfbdebc681be65c5454c052a8082
Set OSS as parent pom, remove dist management, add scm configuration for my GitHub
Madgag group - can use this sed expression:

ack-grep -l --xml '<groupId>org.eclipse.jgit' | xargs sed -i "s/<groupId>org.eclipse.jgit</<groupId>com.madgag</"
Update pom versions to reflect this is an unofficial release

ack-grep -l --xml '<groupId>com.madgag' | xargs sed -i "s/<version>2.2.0-SNAPSHOT</<version>2.2.0.0.1-UNOFFICIAL-ROBERTO-RELEASE-SNAPSHOT</"