Updated from JGit
----------------------------------------------------
JGit commit f1713abcdcb5097d4e44893862bedc6e27dde20e
Prepare 1.1.0 builds

Change-Id: I4cf017cd567543846839612ab3ace6d26233e01d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>

----------------------------------------------------
JGit commit 2a1e20ead5b9333ecf5d299f95ae47321faa678b
Merge branch 'stable-1.0'

* stable-1.0:
  Prepare post v1.0.0.201106051725-r builds
  JGit v1.0.0.201106051725-r
  Update to eclipse.org's latest SUA

----------------------------------------------------
JGit commit 4a4e1f764c7cc1ffe0a86c22db646c4f11785e01
Prepare post v1.0.0.201106051725-r builds

Change-Id: I4839877e1a6fa7782f37423213af8d579727a494
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>

----------------------------------------------------
JGit commit f65513f75397b1f4de6d063962e5cccca5a89cb6
JGit v1.0.0.201106051725-r

Change-Id: I39f4a23cf284505395d511dfedf02b7f5608df95
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>

----------------------------------------------------
JGit commit 0636f9cdda2b0172d229ba95bc32dbf86e981cde
Update to eclipse.org's latest SUA

Change-Id: I0d016ddaed85656c2e680d0bc99829c6ea13b968
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>

----------------------------------------------------
JGit commit f0d62fc609e70200de1a7439cd89059dfe5740b2
Merge branch 'stable-1.0'

* stable-1.0:
  Prepare post v1.0.0.201106011211-rc3 builds
  JGit v1.0.0.201106011211-rc3
  Remove incubation marker
  blame: Compute the origin of lines in a result file

----------------------------------------------------
JGit commit ada903085d1b4ef8c79e3e2d91f49fee7e188f53
Prepare post v1.0.0.201106011211-rc3 builds

Change-Id: I4dec8eba7e35858aef65fcc10f91fad3fe5b52b9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>

----------------------------------------------------
JGit commit 81371d385b5f199341226644238b8856f5e6831d
JGit v1.0.0.201106011211-rc3

Change-Id: I574a05200471c431b3a02ac6ff208dc6aa90f539
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>

----------------------------------------------------
JGit commit f5f1536f3f77160798676e5bd2f8b3c66ad8d72d
Remove incubation marker

Change-Id: I6018ce0cd3b7c8137e137848fe1f04551b257538
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>

----------------------------------------------------
JGit commit a39045604761f94c40aa8fd7db170c237e8fd64e
blame: Compute the origin of lines in a result file

BlameGenerator digs through history and discovers the origin of each
line of some result file.  BlameResult consumes the stream of regions
created by the generator and lays them out in a table for applications
to display alongside of source lines.

Applications may optionally push in the working tree copy of a file
using the push(String, byte[]) method, allowing the application to
receive accurate line annotations for the working tree version.  Lines
that are uncommitted (difference between HEAD and working tree) will
show up with the description given by the application as the author,
or "Not Committed Yet" as a default string.

Applications may also run the BlameGenerator in reverse mode using the
reverse(AnyObjectId, AnyObjectId) method instead of push().  When
running in the reverse mode the generator annotates lines by the
commit they are removed in, rather than the commit they were added in.
This allows a user to discover where a line disappeared from when they
are looking at an older revision in the repository.  For example:

  blame --reverse 16e810b2..master -L 1080, org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RefDirectoryTest.java
           (                                              1080)   }
  2302a6d3 (Christian Halstrick 2011-05-20 11:18:20 +0200 1081)
  2302a6d3 (Christian Halstrick 2011-05-20 11:18:20 +0200 1082)   /**
  2302a6d3 (Christian Halstrick 2011-05-20 11:18:20 +0200 1083)    * Kick the timestamp of a local file.

Above we learn that line 1080 (a closing curly brace of the prior
method) still exists in branch master, but the Javadoc comment below
it has been removed by Christian Halstrick on May 20th as part of
commit 2302a6d3.  This result differs considerably from that of C
Git's blame --reverse feature.  JGit tells the reader which commit
performed the delete, while C Git tells the reader the last commit
that still contained the line, leaving it an exercise to the reader
to discover the descendant that performed the removal.

This is still only a basic implementation.  Quite notably it is
missing support for the smart block copy/move detection that the C
implementation of `git blame` is well known for.  Despite being
incremental, the BlameGenerator can only be run once.  After the
generator runs it cannot be reused.  A better implementation would
support applications browsing through history efficiently.

In regards to CQ 5110, only a little of the original code survives.

CQ: 5110
Bug: 306161
Change-Id: I84b8ea4838bb7d25f4fcdd540547884704661b8f
Signed-off-by: Kevin Sawicki <kevin@github.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>

----------------------------------------------------
JGit commit 8b8ad75ada9d90f8b26e69ca04d4bf512bf43dd4
Fix a complicated multi level nested if block structure to use a single level with multiple returns.

Change-Id: I3f116f37045e83aba5c80d45b987ab075502dcc6

----------------------------------------------------
JGit commit 690c268c793bfc218982130fbfc25870f292295e
Merge branch 'stable-1.0'

* stable-1.0:
  DHT: Support removing a repository name
  DHT: Fix thread-safety issue in AbstractWriteBuffer
  jgit.sh: Implement pager support
  Change EditList to extend ArrayList
  Ensure the HTTP request is fully consumed
  Make sure test repositories are closed
  Fix CloneCommand not to fetch into remote tracking branches when bare
  Update Eclipse IP log for 1.0

Change-Id: I6340d551482e1dda01f82496296d2038b07fa68b

----------------------------------------------------
JGit commit 50f236aff861ab2a6851eb96cff6fe07b775bb5b
DHT: Support removing a repository name

The first step to deleting a repository from the DHT storage is to
remove the name binding in the RepositoryIndexTable, making the
repository unavailable for lookup.

Change-Id: I469bf92f4bf2f555a15949569b21937c14cb142b
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

----------------------------------------------------
JGit commit 042a66fe8c2feef7b831b1999b8cd6e9a0181944
DHT: Fix thread-safety issue in AbstractWriteBuffer

There is a data corruption issue with the 'running' list if a
background thread schedules something onto the buffer while the
application thread is also using it.

Change-Id: I5ba78b98b6632965d677a9c8f209f0cf8320cc3d
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

----------------------------------------------------
JGit commit 0a39fb2ab65dfdbfbf8022cfdfc3975eba7ac6f2
jgit.sh: Implement pager support

If the command is either `diff` or `log`, there is often a lot of
lines of output. Run these commands through $GIT_PAGER, $PAGER, or
`less` in order to make it easier to browse the output on a terminal.

Change-Id: I18b87ea4acf404b94788f2ac2101812bd13e6a0f
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

----------------------------------------------------
JGit commit 8d1ac7a769b3fc4725537376e0e14d3b96ebbe3d
Change EditList to extend ArrayList

There is no reason for this type to contain an ArrayList and try to
hide the implementation. It only slows down execution by adding an
extra layer of method dispatch to each invocation.

Instead subclass from ArrayList.

Change-Id: Ifbb9c7060c2fe3d5a7397c1aa85fbade14088637
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

----------------------------------------------------
JGit commit 67a1a0993f3969357c554b2030cfd794b3c3af89
Ensure the HTTP request is fully consumed

Some servlet containers require the servlet to read the EOF marker
from the input stream before a response can be output if the stream
is using "Transfer-Encoding: chunked"... which is typical for any
sort of large push to a repository over smart HTTP.

Ensure the EOF is always read by the PackParser when it is handling
the stream, and fail fast if there is more data present than expected
since this does indicate a protocol error.

Also ensure the EOF is read by UploadPack before it starts to output
a partial response using packing progress meters.

Change-Id: I131db9dea20b2324cb7c3272a814f21296bc64bd
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

----------------------------------------------------
JGit commit c1525e2aa5e444a2a234de27d6b7189d5d7f715e
Make sure test repositories are closed

Some repositories created during tests are not added to the 'toClose'
list in LocalDiskRepositoryTestCase. Therefore when the tests end
we may have open FileHandles and on Windows this may cause the
tests to fail because we can't delete those files.

This is fixed by adding the possibility to explicitly add
repositories to the list of repos which are closed automatically.

Change-Id: I1261baeef4c7d9aaedd7c34b546393bfa005bbcc
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>

----------------------------------------------------
JGit commit cc2197ed9c3be35c875c8316f17a2d6e8d338c88
Fix CloneCommand not to fetch into remote tracking branches when bare

When cloning into a bare repository we should not create remote
tracking branches (e.g refs/remotes/origin/testX). Branches of the
remote repository should but fetched into into branches of the same
name (e.g refs/heads/testX). Also add the noCheckout option which
would prevent checkout after fetch.

Change-Id: I5d4cc0389f3f30c53aa0065f38119af2a1430909
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>

----------------------------------------------------
JGit commit cc319fff0db7e23e244fe650f4102150da5633d5
Merge 'Fix usage of FileSnapshot in RefDirectory' into stable-1.0

* commit '475461d05266fe13b05bc2c6645b9ef928521b4c':
  Fix usage of FileSnapshot in RefDirectory

Change-Id: Ie65bd8b36f4c6a91602a94e9b54a04a4fb335897

----------------------------------------------------
JGit commit b04be9334494640a693ef5e515af1be4a6983eb5
CleanCommand: add the ability to do a dry run

Change-Id: I7b81a7e34a771951e2e7b789b080b2bfb8656e5c
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>

----------------------------------------------------
JGit commit a00b951323b0d23482a25b2bb813a56fad7f935b
Merge "Fix GitConstructionTest teardown"
----------------------------------------------------
JGit commit 475461d05266fe13b05bc2c6645b9ef928521b4c
Fix usage of FileSnapshot in RefDirectory

RefDirectory was not using FileSnapshot correctly in all places. This
is fixed with this commit. Additionally the constructors for the
different types of refs have been changed to take a FileSnapshot
instead of a modification time.

Change-Id: Ifb6a59e87e8b058a398c38cdfb9d648f0bad4bf8
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>

----------------------------------------------------
JGit commit 802f84650d1930cfdd44f87ba66f32dde722124d
Fix GitConstructionTest teardown

The teardown faile on Windows because the repos were not closed.

Change-Id: I16cf5645558680029682f898386b061796948237
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
----------------------------------------------------
JGit commit d203485780a039b0a65293a7c9bfc1e51e6413a7
Update Eclipse IP log for 1.0

CQ "4876" is jgit's CQ for usage of protobuf, CQ "5135"
is the corresponding Orbit CQ.

Change-Id: I300cf2b5758c7da9c18494325f2f38bb3744e459
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>

----------------------------------------------------
JGit commit 03a6f572b5968dc8f77b5c85e3097448df6ea27e
Merge "Use the stored password instead of prompting for it all the time"
----------------------------------------------------
JGit commit b8c508e54d64628660aa0d907b37a9648923c1f5
DHT: Add sequence RefData

RefData now uses a sequence number as part of the field, ensuring
that updates always increase the sequence number by one whenever
a reference is modified.

Attaching a sequence number to RefData will help with storing
reference log entries during updates. As the sequence number should
be unique within the reference name space, log entries can be keyed
by the sequence number and remain unique.  Making this work over
reference delete-create cycles will require an additional RefTable
API to return the oldest sequence number previously used in the
reference log to seed the recreated reference.

Change-Id: I11cfff2a96ef962e57f29925a3eef41bdbf9f9bb
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>

----------------------------------------------------
JGit commit 6ec6169215eb33683728c583e231eb5fe9617813
DHT: Replace TinyProtobuf with Google Protocol Buffers

The standard Google distribution of Protocol Buffers in Java is better
maintained than TinyProtobuf, and should be faster for most uses.  It
does use slightly more memory due to many of our key types being
stored as strings in protobuf messages, but this is probably worth the
small hit to memory in exchange for better maintained code that is
easier to reuse in other applications.

Exposing all of our data members to the underlying implementation
makes it easier to develop reporting and data mining tools, or to
expand out a nested structure like RefData into a flat format in a SQL
database table.

Since the C++ `protoc` tool is necessary to convert the protobuf
script into Java code, the generated files are committed as part of
the source repository to make it easier for developers who do not have
this tool installed to still build the overall JGit package and make
use of it.  Reviewers will need to be careful to ensure that any edits
made to a *.proto file come in a commit that also updates the
generated code to match.

CQ: 5135
Change-Id: I53e11e82c186b9cf0d7b368e0276519e6a0b2893
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>

----------------------------------------------------
JGit commit 7cad0adc7dd0f1ce261a11b16bd1725a12827161
DHT: Remove per-process ChunkCache

Performance testing has indicated the per-process ChunkCache isn't
very effective for the DHT storage implementation.  If a server is
using the DHT storage backend, it is most likely part of a larger
cluster where requests are distributed in a round-robin fashion
between the member servers.

In such a scenario there is insufficient data locality between
requests to get a good hit ratio on the per-process ChunkCache.  A low
hit ratio means the cache is actually hurting performance by eating up
memory that could otherwise be used for transient request data, and
increasing pressure on the GC when it needs to find free space.

Remove all of the ChunkCache code.  Installations that want to cache
(to reduce database usage) should wrap their Database with a
CacheDatabase and use a network based CacheServer.

I left the ChunkCache in the original DHT storage commit because I
wanted to document in the history of the project that its probably
worth *not* having, but leave open a door for someone to revert this
change if they find otherwise at a later date.

Change-Id: I364d0725c46c5a19f7443642a40c89ba4d3fdd29
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>

----------------------------------------------------
JGit commit aa05559fd6a9099f90c8beeb80364e440e2614a2
Merge "Let RefDirectory use FileSnapShot to handle fast updates"
----------------------------------------------------
JGit commit 05fa1713da0ecc36829f321d798c2b08bf7936ff
Add a DiffFormatter which calculates a patch-id

Adds a class which can be used to calculates a SHA1 of the diff
associated with a patch, similar to git patch-id.

In this version whitespace is not ignored.

Change-Id: I421d15ea905e23df543082786786841cbe3ef10d
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>

----------------------------------------------------
JGit commit 7d380e9c5e1602e0938792869c4fcba88fd0dc2f
Add CleanCommandTest and fix CleanCommand

Bug: 334767
Change-Id: I0a836451ceb668f943b1f353dc65420157810b23
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>

----------------------------------------------------
JGit commit 08f0e1ffed11012e5069945eb730d44f0adbcd68
Add CleanCommand to JGit API

Bug: 334767
Change-Id: I2650c77bc4af2d8f401bbcce5384b44ff2a64ba2
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>

----------------------------------------------------
JGit commit 486e22c91f607bb15ddf3cd301f494912805127f
Use the stored password instead of prompting for it all the time

EGit change Iba3b87293c22e5fe7d989fc312184aa7463c4387 is also required
to make this work for EGit.

Change-Id: Iedc80e133e66d72e78ff0980b6e12634f75eca36
Signed-off-by: Carsten Pfeiffer <carsten.pfeiffer@gebit.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
----------------------------------------------------
JGit commit 2302a6d3ceea2926e785dba57abd58f609684e86
Let RefDirectory use FileSnapShot to handle fast updates

Since this change may affect performance and memory consumption on every
access to a loose ref I explicitly made it a RFC to collect opinions.

Previously RefDirectory.scanRef() was not detecting an update of a
loose ref when the update didn't changed the modification time of
the backing file. RefDirectory cached loose refs and the way to detect
outdated cache entries was to compare lastmodification timestamp on the
file representing the ref. If two updates to the same ref happen faster
than the filesystem-timer granularity (for linux this is 2 seconds)
there is the possiblity that we don't detect the update.

Because of this bug EGit's PushOperationTest only works with 2 second
sleeps inside.

This change let RefDirectory use FileSnapshot to detect such situations.
FileSnapshot helps to remember when a file was last read from disk and
therefore enables to decide when to load a file from disk although
modification time has not changed.

Change-Id: I03b9a137af097ec69c4c5e2eaa512d2bdd7fe080
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>

----------------------------------------------------
JGit commit 16e810b2ec37c2db8bc0e39426be385024a8de8a
Add shortening of note ref names to NoteMap

Change-Id: I224190bbb41c7cbea38388d0148ecc6dc68f3a14
Signed-off-by: Kevin Sawicki <kevin@github.com>

----------------------------------------------------
JGit commit c25c60061d43b521a428301960120794b9fba4f2
Merge "Remove rebase temporary files on checkout failure"
----------------------------------------------------
JGit commit 3344b93c84fa351623bf686d71dff9769e87144b
Add GitAddTask

Change-Id: Ia9a3c9f4728e13d1e62f530b1d843d09afb4eb42
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>

----------------------------------------------------
JGit commit cf846cfb0b2ceb65749561a0ea1cbbc0904a2ee9
Remove rebase temporary files on checkout failure

A checkout conflict during rebase setup should leave the repository
in SAFE state which means ensuring that the rebase temporary files
need to be removed.

Bug: 346813
Change-Id: If8b758fde73ed5a452a99a195a844825a03bae1a
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
Added missing files
Fixed Sharpen.HttpURLConnection.Response to handle a thrown WebException when calling HttpWebRequest.GetResponse().
Don't crash if the repo version is not set

This is a workaround for xamarin bug #350