Only hide gitdir if the repository isn't bare

This problem was raised on the jgit list
https://dev.eclipse.org/mhonarc/lists/jgit-dev/msg02675.html

Change-Id: I8ce8a159120ce3747d31d6f012c6d2c0d0ce7917
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Merge "Only hide gitdir if the repository isn't bare" into stable-3.5
JGit v3.5.1.201410131835-r

Change-Id: I37e049c8e81f963cfb7c17f1af91fd4245766aee
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Prepare 3.5.2-SNAPSHOT builds

Change-Id: Ib2ccdebe80bad0b09d2d31889a3ab89d77e341f6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Merge branch 'stable-3.5'

* stable-3.5:
  Prepare 3.5.2-SNAPSHOT builds
  JGit v3.5.1.201410131835-r
  Only hide gitdir if the repository isn't bare

Change-Id: I171e5fb8718cb6829bb1357859c95b4a29910ac6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
BundleWriter: Support including HEAD in bundle

Bug: 446813
Change-Id: Ide64aec2a995dd7ff6c1325c3ada242a4eb4565e
Signed-off-by: Robin Stocker <robin@nibor.org>
Add retainOnReset(RevFlag) to RevWalk to simplify reset usage

Applications sometimes use a RevFlag instead of a Set<RevObject>
to track boolean state bits about objects being processed. However
this requires careful use of the resetRetain() methods to avoid an
accidental clearing of the RevFlag bits, effectively clearing the
Set<RevObject> the application wanted to track.

Simplify that use case by offering retainOnReset, a collection of
flags that are never cleared by the RevWalk.

Change-Id: I4c05b89b1398e4a4f371eac3a5d1d5edddec838f
Merge "Add retainOnReset(RevFlag) to RevWalk to simplify reset usage"
Initialize 'pathLen' field also for empty directories

Bug: 445363
Change-Id: Ia8428af84fb61ba0d572374a19e8e8c55b138a63
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Merge "Initialize 'pathLen' field also for empty directories"
Reimplementation of ignore rule parser

The current IgnoreRule/FileNameMatcher implementation scales not well
with huge repositories - it is both slow and memory expensive while
parsing glob expressions (bug 440732). Addtitionally, the "double star"
pattern (/**/) is not understood by the old parser (bug 416348).

The proposed implementation is a complete clean room rewrite of the
gitignore parser, aiming to add missing double star pattern support and
improve the performance and memory consumption.

The glob expressions from .gitignore rules are converted to Java regular
expressions (java.util.regex.Pattern). java.util.regex.Pattern code can
evaluate expression from gitignore rules considerable faster (and with
less memory consumption) as the old FileNameMatcher implementation.

CQ: 8828
Bug: 416348
Bug: 440732
Change-Id: Ibefb930381f2f16eddb9947e592752f8ae2b76e1
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Support for Submodule configuration submodule.<name>.ignore

For each submodule native git allows to configure which modifications to
submodules should be ignored by the status command. It is possible to
ignore "none", "all", "dirty", "untracked" [1]. This configuration is
now supported by IndexDiff. The StatusCommand offers the possibility to
specify this mode.

[1] http://git-scm.com/docs/gitmodules

Change-Id: Ifd81d574a680f9b4152945ba70f8ec4af4f452c9
RebaseCommand should ignore submodule modifications

Before a rebase happens the RebaseCommand checks that the working tree
is clean. We don't want to start a rebase on a dirty working tree. If
the working tree is dirty a rebase should not be allowed. But
RebaseCommand should ignore modifications done to submodules. E.g. if a
submodules HEAD points to <x> but the root repository has in index that
the submodule should point to <y> then this should not prohibit a
rebase. Also native git allows a rebase in this case. Since jgit's
StatusCommand has learned to ignore submodule changes this is now used
by the RebaseCommand to determine the repository state correctly.

Bug: 446922
Change-Id: I487bf7484dca3f5501e6e514584e2871524eea19
Enhance SubmoduleWalk with a fast check whether a repo contains
submodules

Change-Id: Id37efb4f4dd77f3b8eb5607d15d32adeda3992d4
Add missing @since tags

Change-Id: I27207bafe0ce31caab25ab9c0be1f22adf151783
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Add missing @since tags in SubmoduleWalk

Change-Id: Ica34e6709a34977422fd528cbd4df0044403e45d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
add missing @since tag in StatusCommand

Change-Id: Ie8d9c3878116488b973dfc80c7c97f174e769d3f
Add new method IndexDiff#getPathsWithIndexMode

Get the list of paths that have the given file mode.

This helps EGit to efficiently determine which modified files are
symlinks and should be shown with a symlink icon in the staging view.

Bug: 429302
Change-Id: Id15f0c6f265667f5b8b57cc2d9f97de568371919
Signed-off-by: Axel Richard <axel.richard@obeo.fr>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Fix non-externalized string warnings in IndexDiff

Change-Id: Ia803182114f0e8b418428e03601f9afc6542ed28
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Do not swallow exception if IndexDiff hits invalid ignore param

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