Unit test for the updating behavior in RepoCommand API.

When update the manifest against a bare repository, RepoCommand will replace
every existing content from the repository with contents populated from the
manifest. Added note for that and a unit test to make sure this behavior.

Change-Id: I1d5960e84bca5aa2a4e86f424d2ddd4197894cdc
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
Merge "Unit test for the updating behavior in RepoCommand API."
Decommission RepositoryBuilder

It's only used for creating FileRepository objects, which
is FileRepositoryBuilder's job...

Change-Id: I99d7bf0a8af29f4f93c5d85e4bd4d25c22c1d604
Signed-off-by: Roberto Tyley <roberto.tyley@gmail.com>
Allow non-static WindowCaches (scoped to repo ObjectDirectory)

Each repository can now optionally have it's own WindowCache, with
independent config separate from the default WindowCache - permitting
concurrent usage of JGit repos with, for instance, different
streamFileThresholds (useful for testing). Some discussion on the JGit
mailing list:

http://dev.eclipse.org/mhonarc/lists/jgit-dev/msg02532.html

Although this commit changes and moves quite a few fields and methods to
achieve it's goal, all breaking changes are within the
org.eclipse.jgit.internal.storage.file package - and 'internal' means
it's API may be modified between releases if necessary, see:

http://dev.eclipse.org/mhonarc/lists/jgit-dev/msg02145.html

Summary of changes:

* WindowCache now offers primarily instance-based methods, and the
  'default' cache is no longer a static field but instead referenced by a
  static AtomicReference, which can have it's value updated as necessary
  (ie EGit can change what the ref points at to change the cache and all
  impacted repos will change to match at the same time).
* ObjectDirectory now holds an atomic-reference to it's current WindowCache
  instance.
* FileRepositoryBuilder now allows the caller to specify WindowCacheConfig,
  which can be used to create an independent WindowCache for the generated
  FileRepository. If not specified, the default WindowCache ref is used.
* FileRepository now specifically takes a FileRepositoryBuilder (rather
  than just a BaseRepositoryBuilder) in it's constructor, because it needs
  to pass the specific WindowCache field along to it's ObjectDirectory.
* PackFile has a new 'getWindow()' method, which assumes responsibility
  (previously held by the now-removed static WindowCache.get() method)
  for handling cache-changes during window loading.

NB: This change only affects WindowCache, DeltaBaseCache remains
statically-configured.

Change-Id: Ibf2ef604bac08885b2b3bd85f0dc31995132b682
Signed-off-by: Roberto Tyley <roberto.tyley@gmail.com>