]> source.dussan.org Git - jgit.git/log
jgit.git
8 years agodebug-rebuild-ref-tree: Copy HEAD into RefTree 06/64506/1
Shawn Pearce [Fri, 15 Jan 2016 22:13:25 +0000 (14:13 -0800)]
debug-rebuild-ref-tree: Copy HEAD into RefTree

HEAD is not part of getRefs(ALL) and must be copied explicitly.
This allows `jgit debug-rebuild-ref-tree --enable` to convert an
existing repository to use RefTree with a local working tree:

  mkdir testRepo
  cd testRepo

  jgit init
  jgit debug-rebuild-ref-tree --enable

  touch a
  jgit add a
  jgit commit -m initial

Change-Id: I46cbc2611b9ae683ef7319dc46af277925dfaee5

8 years agodebug-rebuild-ref-tree: Add --enable flag to turn the database on 05/64505/1
Shawn Pearce [Fri, 15 Jan 2016 20:58:11 +0000 (12:58 -0800)]
debug-rebuild-ref-tree: Add --enable flag to turn the database on

Change-Id: Iad8ebdb0c4c0ad6dcd2b12dd56ffe1be6a20840f

8 years agoRefTreeDatabase: Allow ORIG_HEAD, etc. on non-bare repositories 01/64501/1
Shawn Pearce [Fri, 15 Jan 2016 20:46:33 +0000 (12:46 -0800)]
RefTreeDatabase: Allow ORIG_HEAD, etc. on non-bare repositories

Store these in the bootstrap layer where they are using $GIT_DIR
as the storage directory for any reference that does not contain '/'.

Change-Id: I5595bf514e4475b7c7e799c2c79446597a3abb4a

8 years agoRefTreeDatabase: Expose bootstrap refs in getAdditionalRefs 15/64415/2
Shawn Pearce [Fri, 15 Jan 2016 00:11:15 +0000 (16:11 -0800)]
RefTreeDatabase: Expose bootstrap refs in getAdditionalRefs

By showing the bootstrap layer in getAdditionalRefs() garbage
collector code can be more RefDatabase agnostic and not care about
the special case of RefTree and RefTreeNames for the purposes of
building up the roots to GC. Instead they can combine getRefs(ALL)
and getAdditionalRefs() and have a clean set of roots.

Change-Id: I665cd2456e9316640215b6a08bc728d1356f36d8

8 years agoMerge "Revert "Remove deprecated Tree, TreeEntry, FileTreeEntry and friends""
Shawn Pearce [Fri, 15 Jan 2016 15:45:42 +0000 (10:45 -0500)]
Merge "Revert "Remove deprecated Tree, TreeEntry, FileTreeEntry and friends""

8 years agoRevert "Remove deprecated Tree, TreeEntry, FileTreeEntry and friends" 78/64478/1
Shawn Pearce [Fri, 15 Jan 2016 15:45:36 +0000 (10:45 -0500)]
Revert "Remove deprecated Tree, TreeEntry, FileTreeEntry and friends"

This reverts commit 0f8743d4d7a4f3af1eccea60d45d51d13f1a2ad4.

JGit is unable to iterate its API.

Change-Id: Ie3d6a28e622a5c0cf54768a2299f1c44c0114c19

8 years agoMerge "PackWriter: Declare preparePack object sets as @NonNull"
Shawn Pearce [Wed, 13 Jan 2016 00:45:39 +0000 (19:45 -0500)]
Merge "PackWriter: Declare preparePack object sets as @NonNull"

8 years agoPackWriter: Declare preparePack object sets as @NonNull 02/64202/3
Shawn Pearce [Wed, 13 Jan 2016 00:11:36 +0000 (16:11 -0800)]
PackWriter: Declare preparePack object sets as @NonNull

Require callers to pass in valid sets for both want and have
collections. Offer PackWriter.NONE as a handy constant for an
empty collection for the have part of preparePack instead of null.

Change-Id: Ifda4450f5e488cbfefd728382b7d30797e229217

8 years agoMerge "GC: Pack RefTrees in their own pack"
Shawn Pearce [Tue, 12 Jan 2016 23:49:01 +0000 (18:49 -0500)]
Merge "GC: Pack RefTrees in their own pack"

8 years agoGC: Pack RefTrees in their own pack 66/64166/3
Shawn Pearce [Tue, 12 Jan 2016 18:50:36 +0000 (10:50 -0800)]
GC: Pack RefTrees in their own pack

The RefTree graph needs to be quickly accessed to read references.
It is also distinct graph disconnected from the rest of the
repository. Store the commit and tree objects in their own pack.

Change-Id: Icbb735be8fa91ccbf0708ca3a219b364e11a6b83

8 years agoChange to extensions.refsStorage 92/64092/1
Shawn Pearce [Tue, 12 Jan 2016 04:44:10 +0000 (20:44 -0800)]
Change to extensions.refsStorage

git-core just rerolled the extensible backends series with refsStorage
as the configuration key. Update JGit to match git-core.

Change-Id: If345a2403a996e358b29cfa2a2298f6e8d59d96b

8 years agoRefTree: Change peel suffix to " ^" (space carrot) 26/63926/4
Shawn Pearce [Sun, 10 Jan 2016 01:27:25 +0000 (17:27 -0800)]
RefTree: Change peel suffix to " ^" (space carrot)

Using ^{} as the peel suffix has caused problems when projects used
tags like v2.1 and then v2.1.1, v2.2.2, etc.  The peeled value for
v2.1 was stored very far away in the tree relative to v2.1 itself as
^ sorts in the ASCII/UTF-8 encoding after all other common tag
characters like digits and dots.

Use " ^" instead as space is not valid in a reference name, sorts
before all other valid reference characters (thus forcing next entry
locality) and this looks like a peeled marker for the prior tag.

Change-Id: I26d2247a0428dfe26a9c319c02159502b3a67455

8 years agoFileRepository: Support extensions.refsBackendType = RefTree 70/62970/15
Shawn Pearce [Sat, 9 Jan 2016 20:51:14 +0000 (12:51 -0800)]
FileRepository: Support extensions.refsBackendType = RefTree

This experimental code can be enabled in $GIT_DIR/config:

  [core]
    repositoryformatversion = 1

  [extensions]
    refsBackendType = RefTree

When these are set the repository will read references from the
RefTree rooted by the $GIT_DIR/refs/txn/committed reference.

Update debug-rebuild-ref-tree to rebuild refs/txn/committed only from
the bootstrap layer.  This avoids misuse by rebuilding using packed-refs
and $GIT_DIR/refs tree.

Change-Id: Icf600e4a36b2f7867822a7ab1f1617d73c710a4b

8 years agoRefTreeDatabase: Ref database using refs/txn/committed 69/62969/14
Shawn Pearce [Sat, 28 Nov 2015 07:21:43 +0000 (23:21 -0800)]
RefTreeDatabase: Ref database using refs/txn/committed

Instead of storing references in the local filesystem rely on the
RefTree rooted at refs/txn/committed.  This avoids needing to store
references in the packed-refs file by keeping all data rooted under
a single refs/txn/committed ref.

Performance to scan all references from a well packed RefTree is very
close to reading the packed-refs file from local disk.

Storing a packed RefTree is smaller due to pack file compression,
about 49.39 bytes/ref (on average) compared to packed-refs using
~65.49 bytes/ref.

Change-Id: I75caa631162dc127a780095066195cbacc746d49

8 years agoMerge "RevCommit: Better support invalid encoding headers"
Shawn Pearce [Mon, 11 Jan 2016 20:48:14 +0000 (15:48 -0500)]
Merge "RevCommit: Better support invalid encoding headers"

8 years agoRevCommit: Better support invalid encoding headers 73/64073/1
Shawn Pearce [Mon, 11 Jan 2016 20:30:35 +0000 (12:30 -0800)]
RevCommit: Better support invalid encoding headers

With this support we no longer need the 'utf-8' alias. UTF-8 will be
automatically tried when the encoding header is not recognized and used
if the character sequence cleanly decodes as UTF-8.

Modernize some of the references to use StandardCharsets.

Change-Id: I4c0c88750475560e1f2263180c4a98eb8febeca0

8 years agoRemove deprecated Tree, TreeEntry, FileTreeEntry and friends 14/63914/3
Shawn Pearce [Sat, 9 Jan 2016 05:42:07 +0000 (21:42 -0800)]
Remove deprecated Tree, TreeEntry, FileTreeEntry and friends

These types were deprecated in 0.9.1 (aka 384a19eee07a2f).
If anyone is still using them, its time to stop.

Change-Id: I3f73347ba78c639e0c6a504812bc1a0702f829b1

8 years agoPaths.pathCompare: Utility to sort paths from byte[] 13/63913/4
Shawn Pearce [Sat, 9 Jan 2016 01:28:44 +0000 (17:28 -0800)]
Paths.pathCompare: Utility to sort paths from byte[]

Consolidate copies of this function into one location.

Add some unit tests to prevent bugs that were accidentally
introduced while trying to make this refactoring.

Change-Id: I82f64bbb8601ca2d8316ca57ae8119df32bb5c08

8 years agoAdd Paths utility class 12/63912/1
Shawn Pearce [Sat, 9 Jan 2016 00:56:47 +0000 (16:56 -0800)]
Add Paths utility class

Simple container for some path related utility functions.

Change-Id: Ice2bec6ad12b1e2cea15988c01aa9dd4e016a849

8 years agoMerge changes from topic 'reftree'
Shawn Pearce [Fri, 8 Jan 2016 00:21:55 +0000 (19:21 -0500)]
Merge changes from topic 'reftree'

* changes:
  debug-rebuild-ref-tree: Simple program to build a RefTree
  RefTree: Store references in a Git tree

8 years agodebug-rebuild-ref-tree: Simple program to build a RefTree 68/62968/14
Shawn Pearce [Sat, 28 Nov 2015 03:34:36 +0000 (19:34 -0800)]
debug-rebuild-ref-tree: Simple program to build a RefTree

This tool scans all references in the repository and writes out a new
reference pointing to a single commit whose root tree is a RefTree
containing the current refs of this repository.

It alway skips storing the reference it will write to, avoiding the
obvious cycle.

Change-Id: I20b1eeb81c55dc49dd600eac3bf8f90297394113

8 years agoRefTree: Store references in a Git tree 67/62967/13
Shawn Pearce [Wed, 18 Nov 2015 00:22:18 +0000 (16:22 -0800)]
RefTree: Store references in a Git tree

A group of updates can be applied by updating the tree in one step,
writing out a new root tree, and storing its SHA-1. If references
are stored in RefTrees, comparing two repositories is a matter of
checking if two SHA-1s are identical. Without RefTrees comparing two
repositories requires listing all references and comparing the sets.

Track the "refs/" directory as a root tree by storing references
that point directly at an object as a GITLINK entry in the tree.
For example "refs/heads/master" is written as "heads/master".

Annotated tags also store their peeled value with ^{} suffix, using
"tags/v1.0" and "tags/v1.0^{}" GITLINK entries.

Symbolic references are written as SYMLINK entries with the blob of
the symlink carrying the name of the symbolic reference target.

HEAD is outside of "refs/" namespace so it is stored as a special
"..HEAD" entry. This name is chosen because ".." is not valid in
a reference name and it almost looks like "../HEAD" which names
HEAD if the reader was inside of the "refs/" directory.

A new Command type is required to handle symbolic references and
peeled references.

Change-Id: Id47e5d4d32149a9e500854147edd7d93c1041a39

8 years agoMake sure CLIGitCommand and Main produce (almost) same results 30/63430/5
Andrey Loskutov [Sun, 3 Jan 2016 11:29:55 +0000 (12:29 +0100)]
Make sure CLIGitCommand and Main produce (almost) same results

Currently execution of tests in pgm uses CLIGitCommand which
re-implements few things from Main. Unfortunately this can results in a
different test behavior compared to the real CLI runtime.

The change let CLIGitCommand extend Main and only slightly modifies the
runtime (stream redirection and undesired exit() termination).

Change-Id: I87b7b61d1c84a89e5917610d84409f01be90b70b
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
8 years agobranch command: print help if requested, even if arguments are wrong 29/63429/5
Andrey Loskutov [Sun, 3 Jan 2016 15:15:34 +0000 (16:15 +0100)]
branch command: print help if requested, even if arguments are wrong

git branch -d -h reports an error (because of missing -d option value)
but does not print the help as expected.

To fix this, CmdLineParser must catch, print but do not propagate
exceptions if help is requested.

Bug: 484951
Change-Id: I51265ebe295f22da540792c6a1980b8bdb295a02
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
8 years agoAdded CLIText.fatalError(String) API for tests 28/63428/4
Andrey Loskutov [Sun, 3 Jan 2016 14:27:01 +0000 (15:27 +0100)]
Added CLIText.fatalError(String) API for tests

In different places (Main, TextBuiltin, CLIGitCommand) we report fatal
errors and at same time want to check for fatal errors in the tests.
Using common API simplifies the error testing and helps to navigate to
the actual error check implementation.

Change-Id: Iecde79beb33ea595171f168f46b0b10ab2f339bb
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
8 years agoGitServletResponseTest: Fix testObjectCheckerException 64/63664/3
Shawn Pearce [Wed, 6 Jan 2016 18:17:52 +0000 (10:17 -0800)]
GitServletResponseTest: Fix testObjectCheckerException

The recent ObjectChecker changes to pass in AnyObjectId as part
of the checkCommit method signature meant the override here was no
longer throwing an exception as expected.

Change-Id: I0383018b48426e25a0bc562387e8cd73cbe13129

8 years agoMerge "InMemoryRepository: Abort BatchRefUpdate if a command previously failed"
Shawn Pearce [Wed, 6 Jan 2016 20:18:02 +0000 (15:18 -0500)]
Merge "InMemoryRepository: Abort BatchRefUpdate if a command previously failed"

8 years agoInMemoryRepository: Abort BatchRefUpdate if a command previously failed 71/63671/1
Shawn Pearce [Wed, 6 Jan 2016 20:05:46 +0000 (12:05 -0800)]
InMemoryRepository: Abort BatchRefUpdate if a command previously failed

If any command has already been marked as failing, fail the entire batch.

Change-Id: I1692240841aa4f4cb252bdccbc6f11d9246929c1

8 years agoDFS: Allow other RefDatabase implementations 69/63669/1
Shawn Pearce [Wed, 6 Jan 2016 19:54:08 +0000 (11:54 -0800)]
DFS: Allow other RefDatabase implementations

Permit a DfsRepository implementation to use a different RefDatabase
than DfsRefDatabase.

Change-Id: Ia263285f547bde1943993cc994d0222185021a16

8 years agobuck: Make :jgit_src target work in cross-cell environment 43/63443/2
David Ostrovsky [Sun, 3 Jan 2016 23:44:07 +0000 (00:44 +0100)]
buck: Make :jgit_src target work in cross-cell environment

This artifact is used from unzip utility in Gerrit Code Review
build toolchain and thus the file must exist on the file system.
Moreover, trying to use java_binary() didn't work either, as the
zip layout was wrong: all files contained 'org.eclipse.jgit/src/'
prefix.

Change-Id: I00e3269a7a1a6c6d1fe7e60d1bf1c69b8e57d79d
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
8 years agoMerge changes I487a30fb,I82a01b5f
Shawn Pearce [Sun, 3 Jan 2016 23:24:33 +0000 (18:24 -0500)]
Merge changes I487a30fb,I82a01b5f

* changes:
  Ensure all http tests are run and fix broken tests
  buck: run http tests

8 years agoMerge "buck: set Bundle-Version for :jgit_bin"
Shawn Pearce [Sun, 3 Jan 2016 18:22:57 +0000 (13:22 -0500)]
Merge "buck: set Bundle-Version for :jgit_bin"

8 years agobuck: set Bundle-Version for :jgit_bin 32/63432/1
Shawn Pearce [Sun, 3 Jan 2016 17:30:16 +0000 (09:30 -0800)]
buck: set Bundle-Version for :jgit_bin

Run git describe during the build to determine the lineage of this
working directory and stamp this information into the binary.

Change-Id: I0ad24125c31e4280ccf900bac4065924087b05aa

8 years agoMerge changes Idaed9310,I62bd7c0b
Matthias Sohn [Sun, 3 Jan 2016 15:27:36 +0000 (10:27 -0500)]
Merge changes Idaed9310,I62bd7c0b

* changes:
  ObjectChecker: honor some git-core fsck.* options
  ObjectChecker: allow some objects to skip errors

8 years agobranch command: provide convenient and meaningful options help 32/63332/6
Andrey Loskutov [Mon, 28 Dec 2015 14:47:36 +0000 (15:47 +0100)]
branch command: provide convenient and meaningful options help

Added tests for all options, fixed multi-valued options parsing.

Bug: 484951
Change-Id: I5558589049544ea6c84932bc01f1f9df09e1f682
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
8 years agoSimplify pgm tests: allow varargs and trim output for toString() 15/63415/1
Andrey Loskutov [Sat, 2 Jan 2016 12:24:02 +0000 (13:24 +0100)]
Simplify pgm tests: allow varargs and trim output for toString()

Change-Id: Ia5bcd9e560b90cf872fef75c2800c889ef1cc85a
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
8 years agoFixed few locale dependent pgm tests 14/63414/1
Andrey Loskutov [Sat, 2 Jan 2016 16:32:11 +0000 (17:32 +0100)]
Fixed few locale dependent pgm tests

See https://dev.eclipse.org/mhonarc/lists/jgit-dev/msg03040.html

Change-Id: If51f3c750684d82cb6443f1578636c9f5ca56e2b
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
8 years agoEnsure all http tests are run and fix broken tests 09/63409/1
Matthias Sohn [Sat, 2 Jan 2016 01:09:16 +0000 (02:09 +0100)]
Ensure all http tests are run and fix broken tests

HttpClientTests were broken. This wasn't discovered since
maven-surefire-plugin's by default only executes test classes
matching **/*Test.java. Fix this by also including **/*.Tests.java
and fix the failing tests.

Change-Id: I487a30fb333de993a9f8d8fff491d3b0e7fb02cc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agobuck: run http tests 08/63408/1
Matthias Sohn [Fri, 1 Jan 2016 22:54:15 +0000 (23:54 +0100)]
buck: run http tests

Running tests using buck reveals that HttpClientTests are broken
and weren't executed by Maven since these test classes don't match the
maven-surefire-plugin's default for test classes **/*Test.java.
Will be fixed in a follow-up change.

Change-Id: I82a01b5fd3f0a930bec2423a29a256601dadc248
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agobuck: set vm_args for tests 07/63407/1
Shawn Pearce [Fri, 1 Jan 2016 19:04:11 +0000 (11:04 -0800)]
buck: set vm_args for tests

Maven pom files force the local encoding to UTF-8 to ensure there are
no differences between machines.  They also set the JVM max heap to
256m. Match both in Buck so that results are consistent.

Change-Id: Ice5476dd09352a444a0c97aa0dc28806fddf2ab4

8 years agobuck: pin to stable version 06/63406/1
Shawn Pearce [Fri, 1 Jan 2016 04:07:03 +0000 (20:07 -0800)]
buck: pin to stable version

Like with Gerrit, pin JGit to a single version of Buck that is known
to work with current Buck files and JUnit tests. Notably a more recent
version of Buck used by Gerrit (01a0c54d827) fails WalkEncryptionTest.

Change-Id: I6b94c332e4bde97a1910f48cf12eb8698f97d540

8 years agoMerge changes from topic 'add-df'
Shawn Pearce [Fri, 1 Jan 2016 17:58:34 +0000 (12:58 -0500)]
Merge changes from topic 'add-df'

* changes:
  DirCache: Do not create duplicate tree entries
  DirCacheEditor: Replace file-with-tree and tree-with-file
  AddCommand: Use NameConflictTreeWalk to identify file-dir changes

8 years agoFix "remote: Counting objects: ..." formatting 03/63403/2
Shawn Pearce [Fri, 1 Jan 2016 00:12:51 +0000 (16:12 -0800)]
Fix "remote: Counting objects: ..." formatting

Trailing whitespace is usually removed in properties files so
JGitText did not supply a space between : and the remote message.
Ensure the space exists at runtime by reading the localized string
and appending a space if it is missing.

Messages should be dynamically fetched and not held in a static
class variable, as they can be changed using thread locals.

Change-Id: If6a3707d64094253b1a5304fbfafcf195db7497a

8 years agoclone: display progress messages 02/63402/2
Shawn Pearce [Fri, 1 Jan 2016 00:03:13 +0000 (16:03 -0800)]
clone: display progress messages

Also support -q/--quiet flag to disable progress.

Change-Id: I979277502c990f6dec052d095461c996ff8fe577

8 years agobuck: run tests 01/63401/3
Shawn Pearce [Thu, 31 Dec 2015 18:44:30 +0000 (10:44 -0800)]
buck: run tests

Compile each test in its own java_test() target so they can run in
parallel, reducing total time spent testing on large machines.

$ buck test --all
[-] PROCESSING BUCK FILES...FINISHED 0.3s [100%]
[-] BUILDING...FINISHED 2.9s [100%] (351/383 JOBS, 351 UPDATED, 0.0% CACHE MISS)
[-] TESTING...FINISHED 98.1s (3360 PASS/15 SKIP/0 FAIL)

Change-Id: I8d6541268315089299f933ed23d785b1b3431133

8 years agobuck: build standalone jgit binary 00/63400/2
Shawn Pearce [Thu, 31 Dec 2015 19:18:02 +0000 (11:18 -0800)]
buck: build standalone jgit binary

Construct the java_application JAR wrapped with the shell script
header.  This is enough to clone a repository over HTTPs:

  $ buck build :jgit_bin
  $ buck-out/gen/jgit_bin/jgit_bin clone https://...

Change-Id: I4aceb4e77b2ec9be76a32ec93d94f2dafe9acce6

8 years agoImplement Buck driven build 38/61938/3
David Ostrovsky [Fri, 4 Dec 2015 07:27:57 +0000 (08:27 +0100)]
Implement Buck driven build

Today there are plenty of modern build tool systems available in the
wild (in no particular order):

* http://bazel.io
* https://pantsbuild.github.io
* http://shakebuild.com
* https://ninja-build.org
* https://buckbuild.com

The attributes, that all these build tools have in common, are:

* reliable
* correct
* very fast
* reproducible

It must not always be the other build tool, this project is currently
using. Or, quoting Gerrit Code Review maintainer here:

  "Friends, don't let friends use <the other build tool system>!"

This change is non-complete implementation of JGit build in Buck,
needed by Gerrit Code Review to replace its dependency with standlone
JGit cell. This is very useful when a developer is working on both
projects and is trying to integrate changes made in JGit in Gerrit.

The supported workflow is:

  $ cd jgit
  $ emacs <hack>
  $ cd ../gerrit
  $ buck build --config repositories.jgit=../jgit gerrit

With --config repositories.jgit=../jgit jgit cell is routed through
JGit development tree.

To build jgit, issue:

  $ buck build //:jgit
  [-] PROCESSING BUCK FILES...FINISHED 0,0s

Yes, you can't measure no-op build time, given that Buck daemon is
used.

Change-Id: I301a71b19fba35a5093d8cc64d4ba970c2877a44
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
8 years agoMerge "Fix encoding problem from curl repostory on github"
Shawn Pearce [Thu, 31 Dec 2015 04:47:27 +0000 (23:47 -0500)]
Merge "Fix encoding problem from curl repostory on github"

8 years agoMerge "Fix hanging fetch via SSH"
Shawn Pearce [Thu, 31 Dec 2015 04:27:09 +0000 (23:27 -0500)]
Merge "Fix hanging fetch via SSH"

8 years agoFix encoding problem from curl repostory on github 61/50361/2
Eryk Szymanski [Wed, 17 Jun 2015 15:17:17 +0000 (17:17 +0200)]
Fix encoding problem from curl repostory on github

Pushing curl repository to gerrit fails with a message:
remote: error: internal error while processing changes
java.nio.charset.IllegalCharsetNameException: 'utf8'

curl repository url: https://github.com/bagder/curl.git

To avoid this problem encodingAliases in RawParseUtils have
been extended to contain "'utf8'" (single quoted utf8) string.

Change-Id: I40f613cfdcabf0dc9455bee45116ab8d8c7dd6ee
Signed-off-by: Eryk Szymanski <eryksz@gmail.com>
8 years agoMake sure tests don't blindly continue if a command is "silently" failed 89/63389/1
Andrey Loskutov [Wed, 30 Dec 2015 23:48:07 +0000 (00:48 +0100)]
Make sure tests don't blindly continue if a command is "silently" failed

Make the default execute() function fail fast on first command printed
"fatal: " to output.

Introduced executeUnchecked() for few tests which wanted to test fatal
output.

Change-Id: I5b09aad9443515636811fc4d00bf8b8b9587a626
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
8 years agoObjectChecker: honor some git-core fsck.* options 71/63371/4
Shawn Pearce [Wed, 30 Dec 2015 02:21:19 +0000 (18:21 -0800)]
ObjectChecker: honor some git-core fsck.* options

Accept some of the same section keys that fsck does in git-core,
allowing repositories to skip over specific kinds of acceptable
broken objects, e.g.:

  [fsck]
    duplicateEntries = ignore
    zeroPaddedFilemode = ignore

The zeroPaddedFilemode = ignore is a synonym for the JGit specific
allowLeadingZeroFileMode = true. Only accept the JGit key if git-core
key was not specified.

Change-Id: Idaed9310e2a5ce5511670ead1aaea2b30aac903c

8 years agoObjectChecker: allow some objects to skip errors 63/63363/4
Shawn Pearce [Tue, 29 Dec 2015 23:52:16 +0000 (15:52 -0800)]
ObjectChecker: allow some objects to skip errors

Some ancient objects may be broken, but in a relatively harmless way.
Allow the ObjectChecker caller to whitelist specific objects that are
going to fail checks, but that have been reviewed by a human and decided
the objects are OK enough to permit continued use of.

This avoids needing to rewrite history to scrub the broken objects out.

Honor the git-core fsck.skipList configuration setting when receiving a
push or fetching from a remote repository.

Change-Id: I62bd7c0b0848981f73dd7c752860fd02794233a6

8 years agoRename files using NIO2 atomic rename 69/46469/6
Matthias Sohn [Thu, 23 Apr 2015 00:11:00 +0000 (02:11 +0200)]
Rename files using NIO2 atomic rename

Bug: 319233
Change-Id: I5137212f5cd3195a52f90ed5e4ce3cf194a13efd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoObjectChecker: use java.text.Normalizer directly 85/63385/2
Shawn Pearce [Wed, 30 Dec 2015 20:23:06 +0000 (12:23 -0800)]
ObjectChecker: use java.text.Normalizer directly

Base Java version for JGit is now Java 7. The java.text.Normalizer
class was available in Java 6. Reflection is no longer required to
normalize strings for Mac OS X.

Change-Id: I98e14b72629a7a729a2d40a3aa275932841274e8

8 years agoMerge changes I3db332bf,I614e7110,I37a4ccd6,I86b81e7f,Ic8b362e0, ...
Shawn Pearce [Wed, 30 Dec 2015 20:44:29 +0000 (15:44 -0500)]
Merge changes I3db332bf,I614e7110,I37a4ccd6,I86b81e7f,Ic8b362e0, ...

* changes:
  Sort "eager" path-like options to the end of the help
  reset command: provide convenient and meaningful options help
  commit command: allow to specify path(s) argument(s)
  status command: consume more then one argument after --
  repo command: properly name the required 'path' argument
  Un-ignored existing CLI tests which run just fine on Java 7+
  Don't treat command termination due '-h' option as a fatal error

8 years agoUnify fetch and receive ObjectChecker setup 66/63366/2
Shawn Pearce [Wed, 30 Dec 2015 00:53:56 +0000 (16:53 -0800)]
Unify fetch and receive ObjectChecker setup

This avoids duplication of code between receive-pack and fetch-pack paths.
Separate methods are still required to check use of receive.fsckobjects vs.
fetch.fsckobjects, both of which default to transfer.fsckobjects.

Change-Id: I41193e093e981a79fc2f63914e273aaa44b82162

8 years agoPackWriter: use lib.ObjectIdSet to avoid wrapper 61/63361/2
Shawn Pearce [Tue, 29 Dec 2015 23:11:21 +0000 (15:11 -0800)]
PackWriter: use lib.ObjectIdSet to avoid wrapper

Hoist ObjectIdSet up to lib as part of the public API and add
the interface to some common types like PackIndex and JGit custom
ObjectId map types.  This cleans up wrapper code in a number of
places by allowing direct use of the types as an ObjectIdSet.

Future commits can now rely on ObjectIdSet as a simple read-only
type to check a set of objects from a number of storage options.

Change-Id: Ib62b062421d475bd52abd6c84a73916ef36e084b

8 years agoDirCache: Do not create duplicate tree entries 81/62981/13
Shawn Pearce [Fri, 18 Dec 2015 22:31:20 +0000 (14:31 -0800)]
DirCache: Do not create duplicate tree entries

If a file (e.g.  "A") and a subtree file (e.g. "A/foo.c") both appear
in the DirCache this cache should not be written out as a tree object.
The "A" file and "A" subtree conflict with each other in the same tree
and will fail fsck.

Detect this condition during DirCacheBuilder and DirCacheEditor
finish() so the application can be halted early before it updates a
DirCache that might later write an invalid tree structure.

Change-Id: I95660787e88df336297949b383f4c5fda52e75f5

8 years agoDirCacheEditor: Replace file-with-tree and tree-with-file 29/63329/5
Shawn Pearce [Mon, 28 Dec 2015 19:43:07 +0000 (11:43 -0800)]
DirCacheEditor: Replace file-with-tree and tree-with-file

If a PathEdit tries to store a file where a subtree was, or a subtree
where a file was, replace the entry in the DirCache with the new
name(s).  This supports switching between file and tree entry types
using a DirCacheEditor.

Add new unit tests to cover the conditions where these can happen.

Change-Id: Ie843d9388825f9e3d918a5666aa04e47cd6306e7

8 years agoAddCommand: Use NameConflictTreeWalk to identify file-dir changes 61/63061/4
Shawn Pearce [Thu, 24 Dec 2015 22:27:50 +0000 (14:27 -0800)]
AddCommand: Use NameConflictTreeWalk to identify file-dir changes

Adding a path that already exists but is changing type such as
from symlink to subdirectory requires a NameConflictTreeWalk to
match up the two different entry types that share the same name.

NameConflictTreeWalk needs a bug fix to pop conflicting entries
when PathFilterGroup aborts the walk early so that it does not
allow DirCacheBuilderIterator to copy conflicting entries into
the output cache.

Change-Id: I61b49cbe949ca8b4b98f9eb6dbe7b1f82eabb724

8 years agoSort "eager" path-like options to the end of the help 44/63344/4
Andrey Loskutov [Tue, 29 Dec 2015 13:27:37 +0000 (14:27 +0100)]
Sort "eager" path-like options to the end of the help

The "--" path option (and all other similar options consuming all
remaining arguments) should be placed at the end of the command line
help.

Currently jgit reset -h shows this:

jgit reset [commit-ish] [path ... ...] [-- path ... ...] [--hard]
[--help (-h)] [--mixed] [--soft]

After the patch the help shows this:

jgit reset [commit-ish] [path ... ...] [--hard] [--help (-h)] [--mixed]
[--soft] [-- path ... ...]

Bug: 484951
Change-Id: I3db332bf293ca8d6bfaab0d546cd35af689bd46e
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
8 years agoreset command: provide convenient and meaningful options help 31/63331/4
Andrey Loskutov [Mon, 28 Dec 2015 20:59:01 +0000 (21:59 +0100)]
reset command: provide convenient and meaningful options help

This commit changes the jgit "reset" command line options help from
this:

jgit reset name [VAL ...] [-- path ... ...] [--hard] [--help (-h)]
[--mixed] [--soft]
 name        : Reset current HEAD to the specified state
 [...]

to this:

jgit reset [commit-ish] [path ... ...] [-- path ... ...] [--hard]
[--help (-h)] [--mixed] [--soft]
 commit-ish  : Reset to given reference name
 [...]

Bug: 484951
Change-Id: I614e71101b4f9f46ef8f02379d1a9d135f3292d2
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
8 years agocommit command: allow to specify path(s) argument(s) 43/63343/3
Andrey Loskutov [Tue, 29 Dec 2015 12:58:58 +0000 (13:58 +0100)]
commit command: allow to specify path(s) argument(s)

This fixes the command below:

jgit commit a -m "added file a"

which currently fails with:

org.eclipse.jgit.api.errors.JGitInternalException: The combination of
arguments --all and --only is not allowed

Bug: 484973
Change-Id: I37a4ccd68101a66520ef99110f7aa0cbdcc8beba
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
8 years agostatus command: consume more then one argument after -- 42/63342/3
Andrey Loskutov [Tue, 29 Dec 2015 12:18:12 +0000 (13:18 +0100)]
status command: consume more then one argument after --

See bug 484951 comment 4: "jgit status -- a b" doesn't work and
complains that "b" is not an allowed argument

Bug: 484951
Change-Id: I86b81e7f2bab6e928bb8e973bd50c8f4b9c6fecf
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
8 years agorepo command: properly name the required 'path' argument 21/63321/4
Andrey Loskutov [Mon, 28 Dec 2015 17:14:05 +0000 (18:14 +0100)]
repo command: properly name the required 'path' argument

Fixes point 4 in bug 484951, where "jgit repo" or "jgit repo -h" dumps a
stack trace.

Bug: 484951
Change-Id: Ic8b362e07a40ad923dc9acde0c0983a1e7932a02
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
8 years agoUn-ignored existing CLI tests which run just fine on Java 7+ 19/63319/5
Andrey Loskutov [Mon, 28 Dec 2015 17:03:45 +0000 (18:03 +0100)]
Un-ignored existing CLI tests which run just fine on Java 7+

Change-Id: I5ef334a49fb2d88d5e856b443687f3dcb126a77a
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
8 years agoDon't treat command termination due '-h' option as a fatal error 30/63330/3
Andrey Loskutov [Mon, 28 Dec 2015 22:27:09 +0000 (23:27 +0100)]
Don't treat command termination due '-h' option as a fatal error

Signal early command termination due '-h' or '--help' option via
TerminatedByHelpException. This allows tests using
CLIGitCommand differentiate between unexpected command parsing errors
and expected command cancellation "on help" (which also allows
validation of expected/unexpected help messages).

Additional side-effect: jgit supports now git style of handling help
option: any unexpected command line options before help are reported as
errors, but after help ignored.

Bug: 484951
Change-Id: If45c41c0d32895ab6822a7ff9d851877dcef5771
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
8 years agoProvide a root cause for aborted commands 20/63320/2
Andrey Loskutov [Mon, 28 Dec 2015 17:13:35 +0000 (18:13 +0100)]
Provide a root cause for aborted commands

Change-Id: Iafaa03dbacbe7f1b2b074d3294db988b08fdb0d7
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
8 years agoSimplify development of commands: added main() to CLIGitCommand 15/63315/3
Andrey Loskutov [Mon, 28 Dec 2015 14:42:04 +0000 (15:42 +0100)]
Simplify development of commands: added main() to CLIGitCommand

This will execute git commands (with arguments) specified on the command
line, handy for developing/debugging a sequence of arbitrary git
commands working on same repository.

The git working dir path can be specified via Java system property
"git_work_tree". If not specified, current directory will be used.

Change-Id: I621a9ec198c31e28a383818efeb4b3f835ba1d6f
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
8 years agoDirCacheEditor: Cleanup DeleteTree constructor 23/63323/1
Shawn Pearce [Thu, 24 Dec 2015 23:46:19 +0000 (15:46 -0800)]
DirCacheEditor: Cleanup DeleteTree constructor

Neaten up formatting and avoid strings, which prevents the need for
NLS comment tags.  Instead check the last character using char
literal, and append a char literal instead of a string.

Change-Id: Ib68e017769a1f5c03200354a805769d585a48c8b

8 years agoDirCacheEditor: Fix formatting to avoid , at start of line 22/63322/1
Shawn Pearce [Thu, 24 Dec 2015 23:38:02 +0000 (15:38 -0800)]
DirCacheEditor: Fix formatting to avoid , at start of line

Change-Id: I1b1d614470c67fe4736fdc9c26ae26fb38dd58b5

8 years agoMerge "AddCommand: Avoid unnecessary string conversions"
Shawn Pearce [Mon, 28 Dec 2015 19:24:30 +0000 (14:24 -0500)]
Merge "AddCommand: Avoid unnecessary string conversions"

8 years agoMerge "AddCommand: Cleanup conditional logic"
Christian Halstrick [Mon, 28 Dec 2015 13:39:06 +0000 (08:39 -0500)]
Merge "AddCommand: Cleanup conditional logic"

8 years agoAllow checkout paths without specifying branch name 79/62879/7
Andrey Loskutov [Wed, 16 Dec 2015 23:12:04 +0000 (00:12 +0100)]
Allow checkout paths without specifying branch name

JGit CLI should allow to do this: checkout -- <path>

Currently, even if "a" is a valid path in the git repo, jgit CLI can't
checkout it:
$jgit checkout -- a
error: pathspec 'a' did not match any file(s) known to git.

The fix also fixes at same time "unnamed" zombie "[VAL ...]" argument
shown on the command line.

Before fix:
$jgit -h
jgit checkout name [VAL ...] [-- path ... ...] [--force (-f)] [--help
(-h)] [--orphan] [-b]

After fix:
$jgit -h
jgit checkout [name] [-- path ... ...] [--force (-f)] [--help (-h)]
[--orphan] [-b]

Bug: 475765
Change-Id: I2b0e77959a72e4aac68452dc3846adaa745b0831
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
8 years agoAddCommand: Avoid unnecessary string conversions 57/63257/4
Shawn Pearce [Thu, 24 Dec 2015 06:06:05 +0000 (22:06 -0800)]
AddCommand: Avoid unnecessary string conversions

Change-Id: I13634caeccd9f675a86adfdfa94099b6fb75463a

8 years agoAddCommand: Cleanup conditional logic 55/63255/1
Shawn Pearce [Thu, 24 Dec 2015 04:15:00 +0000 (20:15 -0800)]
AddCommand: Cleanup conditional logic

Unnest and simplify conditional logic for handling entries.

Change-Id: I3093cab5f0edfaf3efbbd6c644e9c922edc67d38

8 years agoClose copy threads in case of errors 17/63117/2
Dmitry Neverov [Mon, 21 Dec 2015 19:15:42 +0000 (20:15 +0100)]
Close copy threads in case of errors

Bug: 484775
Change-Id: I3c7105188e615b6b994261f4ece0c8abc98eb444
Signed-off-by: Dmitry Neverov <dmitry.neverov@gmail.com>
8 years agoSkip nested copyfiles in RepoCommand. 83/62983/8
Yuxuan 'fishy' Wang [Fri, 18 Dec 2015 02:27:56 +0000 (18:27 -0800)]
Skip nested copyfiles in RepoCommand.

Similar to nested directories, nested copyfiles won't work with git submodule
either.

Change-Id: Idbe965ec20a682fca0432802858162f8238f05de
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
8 years agoRemove unused import 'org.apache.commons.codec.binary' 15/62815/2
Rüdiger Herrmann [Wed, 16 Dec 2015 12:18:52 +0000 (13:18 +0100)]
Remove unused import 'org.apache.commons.codec.binary'

Change-Id: I7db35f4360e29d006d1e4e6ccfaa78ae598e3b4e
Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de>
8 years agoCheckout should be able to override modified symbolic links 40/62840/5
Andrey Loskutov [Wed, 16 Dec 2015 15:41:34 +0000 (16:41 +0100)]
Checkout should be able to override modified symbolic links

Handle existing symlink as a file, not as directory if deleting a file
before creating (overriding) a symlink.

Bug: 484491
Change-Id: I29dbf57d1daec2ba98454975b093e1d381d05196
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
8 years agoMerge "ProgressSpinner: Simple busy wait entertainment"
Shawn Pearce [Wed, 16 Dec 2015 21:20:57 +0000 (16:20 -0500)]
Merge "ProgressSpinner: Simple busy wait entertainment"

8 years agoProgressSpinner: Simple busy wait entertainment 46/62846/2
Shawn Pearce [Fri, 4 Dec 2015 22:56:14 +0000 (14:56 -0800)]
ProgressSpinner: Simple busy wait entertainment

Keep a user amused while the server does work by spinning a
little ASCII-art object on a single line.

Change-Id: Ie8f181d1aa606d4ae69e5d3ca4db387cea739f38

8 years agoIncluded cached deltas in delta packStatistics. 64/62864/1
James Kolb [Tue, 15 Dec 2015 22:14:45 +0000 (17:14 -0500)]
Included cached deltas in delta packStatistics.

Previously, non-reuse deltas were only included in packStatistics if they
were not cached by the deltaWindow.

Change-Id: I7684d8214875f0a7569b34614f8a3ba341dbde9c
Signed-off-by: James Kolb <jkolb@google.com>
8 years agoMerge changes Ib4d53bdd,I55bd512c
Jonathan Nieder [Wed, 16 Dec 2015 17:09:48 +0000 (12:09 -0500)]
Merge changes Ib4d53bdd,I55bd512c

* changes:
  Do not let PathFilter.create("a/b") match 'a' unless 'a' is a subtree
  Add tests for PathFilterGroup.Single

8 years agoMerge "Fix InterruptTimer leak in BasePackConnection"
Shawn Pearce [Wed, 16 Dec 2015 15:29:01 +0000 (10:29 -0500)]
Merge "Fix InterruptTimer leak in BasePackConnection"

8 years agoMerge "Fix NPE in HttpSupport"
Shawn Pearce [Wed, 16 Dec 2015 15:28:05 +0000 (10:28 -0500)]
Merge "Fix NPE in HttpSupport"

8 years agoFix InterruptTimer leak in BasePackConnection 67/53767/4
Matthias Sohn [Fri, 14 Aug 2015 12:03:57 +0000 (14:03 +0200)]
Fix InterruptTimer leak in BasePackConnection

When setting timeout on push, BasePackConnection creates a timer, which
will be terminated when push finishes. But, when using
SmartHttpPushConnection, it dropped the first timer created in the
constructor and then created another timer in doPush. If new threads are
created faster than the gc collects then this may stop the service if
it's hitting the max process limit. Hence don't create a new timer if it
already exists.

Bug: 474947
Change-Id: I6746ffe4584ad919369afd5bdbba66fe736be314
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoFix NPE in HttpSupport 12/62112/3
Matthias Sohn [Wed, 2 Dec 2015 12:11:20 +0000 (13:11 +0100)]
Fix NPE in HttpSupport

Bug: 483366
Change-Id: I107f1b44e0e6371e3cfbd1cc18a970412e1fc679
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoMerge "Refspec: loosen restrictions on wildcard "*""
Shawn Pearce [Wed, 16 Dec 2015 04:22:11 +0000 (23:22 -0500)]
Merge "Refspec: loosen restrictions on wildcard "*""

8 years agoMerge "BaseRepositoryBuilder should trim CR from .git symref"
Shawn Pearce [Wed, 16 Dec 2015 04:18:13 +0000 (23:18 -0500)]
Merge "BaseRepositoryBuilder should trim CR from .git symref"

8 years agoMerge "Fix possible arithmetic overflow when setting a timeout"
Shawn Pearce [Wed, 16 Dec 2015 04:16:19 +0000 (23:16 -0500)]
Merge "Fix possible arithmetic overflow when setting a timeout"

8 years agoMerge "Accept UTF8 BOM with BlobBasedConfig"
Shawn Pearce [Wed, 16 Dec 2015 04:12:54 +0000 (23:12 -0500)]
Merge "Accept UTF8 BOM with BlobBasedConfig"

8 years agoMerge "Bug 484342: Support @ in username in SSH url."
Shawn Pearce [Wed, 16 Dec 2015 04:09:29 +0000 (23:09 -0500)]
Merge "Bug 484342: Support @ in username in SSH url."

8 years agoDo not let PathFilter.create("a/b") match 'a' unless 'a' is a subtree 91/62691/2
Jonathan Nieder [Tue, 15 Dec 2015 03:57:24 +0000 (19:57 -0800)]
Do not let PathFilter.create("a/b") match 'a' unless 'a' is a subtree

PathFilter and PathFilterGroup form JGit's implementation of git's
path-limiting feature in commands like log and diff.  To save time
when traversing trees, a path specification

foo/bar/baz

tells the tree walker not to traverse unrelated trees like qux/.  It
does that by returning false from include when the tree walker is
visiting qux and true when it is visiting foo.

Unfortunately that test was implemented to be slightly over-eager: it
doesn't only return true when asked whether to visit a subtree "foo"
but when asked about a plain file "foo" as well.  As a result, diffs
and logs restricted to some-file/non-existing-suffix unexpectedly
match against some-file:

 $ jgit log -- LICENSE/no-such-file
 commit 629fd0d594d242eab26161b0dac34f7576fd4d3d
 Author: Shawn O. Pearce <spearce@spearce.org>
 Date:   Fri Jul 02 14:52:49 2010 -0700

     Clean up LICENSE file
[...]

Fix it by checking against the entry's mode.

Gitiles +log has the same bug and benefits from the same fix.

Callers know not to worry about what subtrees are included in the tree
walk because shouldBeRecursive() returns true in this case, so this
behavior change should be safe.  This also better matches the behavior
of C git:

 $ empty=$(git mktree </dev/null)
 $ git diff-tree --abbrev $empty HEAD -- LICENSE/no-such-file
 $ git diff-tree --abbrev $empty HEAD -- tools/no-such-file
 :000000 040000 0000000... b62648d... A  tools

Bug: 484266
Change-Id: Ib4d53bddd8413a9548622c7b25b338d287d8889d

8 years agoAdd tests for PathFilterGroup.Single 90/62690/2
Jonathan Nieder [Tue, 15 Dec 2015 03:22:25 +0000 (19:22 -0800)]
Add tests for PathFilterGroup.Single

Expand the existing PathFilterGroup tests to check which paths the
tree entry matches.  This expands test coverage by ensuring that
PathFilterGroup's simpler code path to match against a single
PathFilter works correctly.

While at it, move the check on tree entry d/e/f/g.y into two separate
tests: one to check that it doesn't match any of the configured paths,
and another to check that it does not throw StopWalkException to end
the walk early.

Change-Id: I55bd512cd049fc2018659e2f86a4b8650f171fda

8 years agoBug 484342: Support @ in username in SSH url. 86/62686/4
Mike Gilbode [Tue, 15 Dec 2015 06:59:00 +0000 (01:59 -0500)]
Bug 484342: Support @ in username in SSH url.

Change-Id: I5795e925afff796488ba26c83694e806b76a374f
Signed-off-by: Mike Gilbode <gilbode@gmail.com>
8 years agoFix push with jgit pgm failing with "unauthorized" 20/62120/4
Matthias Sohn [Fri, 27 Nov 2015 10:46:21 +0000 (11:46 +0100)]
Fix push with jgit pgm failing with "unauthorized"

Pushing with JGit commandline to e.g. Github failed with "unauthorized"
since HttpUrlConnection calls the configured authenticator implicitly.

The problem is that during a push two requests are sent to the server,
first a GET and then a POST (containing the pack data). The first GET
request sent anonymously is rejected with 401 (unauthorized). When an
Authenticator is installed the java.net classes will use the
Authenticator to ask the user for credentials and retry the request.
But this happens under the hood and JGit level code doesn't see that
this happens.

The next request is the POST but since JGit thinks the first GET request
went through anonymously it doesn't add authentication headers to the
POST request. This POST of course also fails with 401 but since this
request contains a lot of body-data streamed from JGit (the pack file!)
the java.net classes can't simply retry the request with authorization
headers. The whole process fails.

Fix this by using Apache httpclient which doesn't use Authenticator to
retrieve credentials. Instead initialize TransportCommand to use the
default credential provider if no other credentials provider was set
explicitly. org.eclipse.jgit.pgm.Main sets this default for the JGit
command line client.

Change-Id: Ic4e0f8b60d4bd6e69d91eae0c7e1b44cdf851b00
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoEnable retrieval of credentials from .netrc for AwtCredentialsProvider 19/62119/3
Matthias Sohn [Fri, 27 Nov 2015 10:26:38 +0000 (11:26 +0100)]
Enable retrieval of credentials from .netrc for AwtCredentialsProvider

This was done for ConsoleCredentialsProvider earlier, we need the
AwtCredentialsProvider for debugging jgit command line since there is no
console in Eclipse. Hence also add support for .netrc here.

Change-Id: Ibbd45b73efc663821866754454cea65e6d03f832
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoMerge "NetRCCredentialsProvider should return false if any item is missing"
Christian Halstrick [Tue, 15 Dec 2015 11:44:07 +0000 (06:44 -0500)]
Merge "NetRCCredentialsProvider should return false if any item is missing"