Commit Graph

6038 Commits

Author SHA1 Message Date
Matthias Sohn 5f46661cae Update to latest Photon Orbit R20180606145124
also add missing bundle org.hamcrest

Change-Id: I88ad7769b8fda491fe3641ddaf0964ca55ffc0f6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-07 14:45:12 +02:00
David Pursehouse 0d908de53f Update maven plugins to fix Zip Slip vulnerability
Zip Slip [1] is an arbitrary file write generic vulnerability, that can
be achieved using a specially crafted zip (or bzip2, gzip, tar, xz, war)
archive, that holds path traversal filenames.

According to Maven's announcement [2] several plugins use plexus-archiver to
unpack dependencies to disk and have been identified as potential triggers
for exposing the vulnerability.

Of those, JGit uses the maven-dependency-plugin and the maven-javadoc-plugin.

Update them to the fixed versions reported in [2].

See the corresponding issues for the maven-dependency-plugin [3] and the
maven-javadoc-plugin [4] for details.

[1] https://snyk.io/research/zip-slip-vulnerability
[2] https://maven.apache.org/security-plexus-archiver.html
[3] https://issues.apache.org/jira/browse/MDEP-611
[4] https://issues.apache.org/jira/browse/MJAVADOC-520

Change-Id: Id3ab2d6161db240f2ab8f82298fa3ecd7a930a43
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-06-06 13:34:34 +09:00
Matthias Sohn a3738ef137 Ensure index change event is fired when index snapshot changed
Ensure that notifyIndexChanged is called every time we call
FileSnapshot.save, except the first.

Change-Id: I5a4e9826e791f518787366ae7c3a0ef3d416d2c1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-06 00:45:27 +02:00
Matthias Sohn cb0abf787e Prepare 5.0.0-SNAPSHOT builds
Change-Id: I9acca328146aa7100fbc1b457fcb1f8fd87cf52a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-05 15:31:07 +02:00
Matthias Sohn ca57743a45 JGit v5.0.0.201806050710-rc3
Change-Id: Ic7a6a87dd3a21351e60fbf6cd330456adf1f6800
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-05 13:10:10 +02:00
Jonathan Tan 7dbd2bfe7e Teach UploadPack "filter" in protocol v2 fetch
If the configuration variable uploadpack.allowfilter is true, advertise
that "filter" is supported, and support it if the client sends such an
argument.

Change-Id: I7de66c0a0ada46ff71c5ba124d4ffa7c47254c3b
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
2018-06-04 22:09:07 -07:00
Jonathan Tan c9d4609ecb Refactor test of capabilities output
A subsequent patch will dynamically generate the capability
advertisement, so the capability advertisements produced are not always
the same. Separate the checking of the advertisements into its own test
method.

Change-Id: I768d14b9d1a244d5d886c42ffd62ef3957b518fb
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
2018-06-04 22:09:07 -07:00
Jonathan Tan e319a6f8d4 Refactor v2 advertisement into own function
A subsequent patch needs dynamic generation of this advertisement
depending on a configuration variable in the underlying repository, so
refactor it into a function instead of using a constant list.

Change-Id: Ie00584add1fb56c9e88c7b57f75703981ea5bb85
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
2018-06-04 22:09:06 -07:00
Jonathan Tan 62c4d3a133 Refactor parsing of "filter" into its own method
The implementation of protocol v2 will also need to parse the "filter"
option, so refactor it into its own method.

Change-Id: I751f6e6ca63fab873298594653a3885202297a2e
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
2018-06-04 22:08:29 -07:00
Jonathan Tan 2f60804396 Disallow unknown args to "fetch" in protocol v2
JGit's implementation of the fetch command of protocol v2, unlike its
implementation of ls-refs, currently tolerates unknown arguments.
Tighten fetch to not allow unrecognized arguments and add tests to
verify this behavior for both ls-refs and fetch.

Change-Id: I321161d568bd638252fab1a47b06b924d472a669
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
2018-06-04 22:08:21 -07:00
Jonathan Tan f7e501c36c Teach UploadPack shallow fetch in protocol v2
Add support for the "shallow" and "deepen" parameters in the "fetch"
command in the fetch-pack/upload-pack protocol v2. Advertise support for
this in the capability advertisement.

TODO: implement deepen-relative, deepen-since, deepen-not

Change-Id: I7ffd80d6c38872f9d713ac7d6e0412106b3766d7
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-06-04 22:08:18 -07:00
Jonathan Tan cd0d69ffec Refactor unshallowCommits to local variable
This reduces the amount of state held as instance variables in
UploadPack, and makes it easier for a future patch to contain a clearer
version of UploadPack#processShallow.

Change-Id: I6df80b42f9e5118fda1420692e02e417670cced3
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-06-04 22:04:18 -07:00
Jonathan Tan f516c1df9d Add protocol v2 support in http
Teach UploadPack to support protocol v2 with non-bidirectional pipes,
and add support to the HTTP protocol for v2. This is only activated if
the repository's config has "protocol.version" equal to 2.

Change-Id: I093a14acd2c3850b8b98e14936a716958f35a848
Helped-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-06-04 21:59:20 -07:00
Jonathan Tan c32a62cd4a Give info/refs services more control over response
Currently, SmartServiceInfoRefs always prints "# service=serviceName"
followed by a flush packet in response to an info/refs request, and then
hands it off to the specific service class. Printing of "#
service=serviceName" is mandated for protocol v0, but not v2.

Therefore, the existing code works for protocol v0, but whenever a
service that supports protocol v2 receives an info/refs request, it must
first determine which protocol version is to be used (depending on, for
example, the request and any relevant configuration variables), and then
decide if "# service=serviceName" needs to be printed.

Create a new method that v2-supporting service classes can override,
covering the printing of both "# service=serviceName" and everything
that the #advertise method prints. This will be used in a subsequent
commit in which UploadPackServlet (and the other classes it uses) is
updated to support protocol v2.

Change-Id: Ia026b06e96a6b15937514096babd024ef77df1ea
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-06-04 21:54:25 -07:00
Mincong HUANG 36a8c21069 Chain RemoteAddCommand methods
Change-Id: I1cf64c90a5cd2220034810b0d65d59582b420c4e
Signed-off-by: Mincong Huang <mincong.h@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-02 02:04:20 +02:00
Matthias Sohn bbf7ca3eda Update target platforms to Orbit R20180531190352-Photon
Use the final Photon Orbit release

Change-Id: Ie07eb3dedb5ccb6a2a7b0ad2c90593a07fdd240e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-01 14:18:29 +02:00
Matthias Sohn c473bbf802 Prepare 5.0.0-SNAPSHOT builds
Change-Id: I9c4a0465f8e85041d24da97f4b4c7ad5f5eed3e4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-05-30 23:16:23 +02:00
Matthias Sohn dbf091a7ee JGit v5.0.0.201805301535-rc2
Change-Id: Ifad678794525c01838b03e52bada66e1c089c5ae
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-05-30 21:33:49 +02:00
Matthias Sohn f2e0ace1e0 Fix description property in feature.properties of pgm source feature
Change-Id: I29c7bf1dc6aaf71542e2529883d44dcd995e17f7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-05-30 01:14:14 +02:00
Matthias Sohn eecf06ca42 Update SUA
Following [1] update SUA in license.html [2] and feature.properties [3]

[1] https://www.eclipse.org/projects/handbook/#legaldoc-plugins
[2] https://www.eclipse.org/legal/epl/notice.html
[3] https://www.eclipse.org/legal/epl/feature.properties.txt

Bug: 532265
Change-Id: Ia3929808154510ad09ceeead263a3fe0dba9a34a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-05-29 17:47:29 +02:00
Thomas Wolf de21c58d03 Don't prune symbolic refs when fetch.prune = true
The canonical implementation also doesn't. Compare current
code in remote.c, function get_stale_heads_cb.[1] Not handling
symrefs in this case was introduced in canonical git in [2]
in 2008.

[1] https://github.com/git/git/blob/v2.17.0/remote.c#L2259
[2] https://github.com/git/git/commit/740fdd27f0

Bug: 533549
Change-Id: If348d56bb4a96b8aa7141f7e7b5a0d3dd4e7808b
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-05-25 06:08:25 -05:00
Matthias Sohn 9ad7031381 Prepare 5.0.0-SNAPSHOT builds
Change-Id: Ie343ccf37f46168041046500a2e19acc80814cfe
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-05-23 01:54:32 +02:00
Matthias Sohn 812abefd58 JGit v5.0.0.201805221745-rc1
Change-Id: Ie2c35fab87f294b00f9754b07b60a848bf256b10
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-05-22 23:43:43 +02:00
Matthias Sohn ce5cdea143 Merge branch 'master' into stable-5.0
* master:
  DescribeCommand: Refactor to not use deprecated Repository#peel
  Repository: Deprecate #peel method
  Repository: Make #exactRef and #findRef final
  Skip ignored directories in FileTreeIterator
  Repository: Deprecate getTags method
  InfoRefsServlet: Refactor to not use deprecated methods
  RefAdvertiser: Add send(Collection<Ref>) and deprecate send(Map<String, Ref>)
  Remove deprecated Repository#notifyIndexChanged
  Implementors should override Repository#notifyIndexChanged(boolean)
  Revive Repository#notifyIndexChanged()
  Remove further unnecessary 'final' keywords
  Execute AdvertiseRefsHook only for protocol v0 and v1
  Add protocol v2 support in "jgit daemon"
  Teach UploadPack "ofs-delta" in "fetch"
  Teach UploadPack "include-tag" in "fetch"
  Avoid using #refs in UploadPack#sendPack
  FileRepository: Don't use deprecated RefDatabase#getRefs(String)
  BatchRefUpdate: Don't use deprecated RefDatabase#getRefs(String)

Change-Id: I16c5da62d09262d3f4070aa0f466dd6c8352b5ea
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-05-22 23:00:51 +02:00
David Pursehouse 51599ebb84 DescribeCommand: Refactor to not use deprecated Repository#peel
Change-Id: I76073ad62d1bc4fc21d8a1f5fc7eb92060a73baa
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-05-22 12:08:08 +09:00
David Pursehouse f6c4a492d0 Repository: Deprecate #peel method
Callers should use getRefDatabase().peel(ref) instead since it
doesn't swallow the IOException.

Adapt all trivial callers to user the alternative.

DescribeCommand still uses the deprecated method and is not adapted in
this change since it will require more refactoring to add handling of
the IOException.

Change-Id: I14d4a95a5e0570548753b9fc5c03d024dc3ff832
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-05-22 11:49:37 +09:00
David Pursehouse e701c59a85 Repository: Make #exactRef and #findRef final
This means less cognitive overhead for both implementors and callers,
since this way we can guarantee that they are always synonyms for
RefDatabase#exactRef and RefDatabase#findRef, respectively.

Change-Id: Ic8aeb52fc7ed65672f3f6cd1da39a66908d88baa
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-05-22 10:21:42 +09:00
Thomas Wolf d7deda98d0 Skip ignored directories in FileTreeIterator
Make FileTreeIterator not enter ignored directories by default. We
only need to enter ignored directories if we do some operation against
git, and there is at least one tracked file underneath an ignored
directory.

Walking ignored directories should be avoided as much as possible as
it is a potential performance bottleneck. Some projects have a lot of
files or very deep hierarchies in ignored directories; walking those
may be costly (especially so on Windows). See for instance also bug
500106.

Provide a FileTreeIterator.setWalkIgnoredDirectories() operation to
force the iterator to iterate also through otherwise ignored
directories. Useful for tests (IgnoreNodeTest, CGitIgnoreTest), or
to implement things like "git ls-files --ignored".

Add tests in DirCacheCheckoutTest, and amend IndexDiffTest to test a
little bit more.

Bug: 388582
Change-Id: I6ff584a42c55a07120a4369fd308409431bdb94a
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-05-22 03:03:35 +02:00
David Pursehouse 1da2ff7242 Repository: Deprecate getTags method
Callers should use getRefDatabase().getRefsByPrefix(R_TAGS) instead.

Adjust the tests accordingly.

Bug: 534731
Change-Id: Ib28ae365e42720268996ff46e34cae1745ad545c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-05-22 09:40:54 +09:00
David Pursehouse 4132dc5858 Merge changes Ibf6ee80d,I721db0f4,I7d014890
* changes:
  Remove deprecated Repository#notifyIndexChanged
  Implementors should override Repository#notifyIndexChanged(boolean)
  Revive Repository#notifyIndexChanged()
2018-05-21 19:15:22 -04:00
David Pursehouse a2b10e56bd InfoRefsServlet: Refactor to not use deprecated methods
- Replace RefDatabase#getRefs(String) with #getRefsByPrefix(String)
- Replace RefAdvertiser#send(Map<String, Ref>) with #send(Collection<Ref>)

Bug: 534731
Change-Id: I25b617c3b0c54793cf4ab5b62f002e17745a5377
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-05-21 10:57:47 +09:00
David Pursehouse 04560921c3 RefAdvertiser: Add send(Collection<Ref>) and deprecate send(Map<String, Ref>)
Bug: 534731
Change-Id: If15032a34dc62f420569e2b2b6d8e14e2dfed522
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-05-21 10:57:47 +09:00
Jonathan Nieder e9d2a8bd85 Remove deprecated Repository#notifyIndexChanged
It is no longer used.

Change-Id: Ibf6ee80d5b6cd554295f4e657e087302770621b6
2018-05-18 09:23:03 -07:00
Jonathan Nieder 8c580dd4c0 Implementors should override Repository#notifyIndexChanged(boolean)
Declare Repository#notifyIndexChanged() final and
Repository#notifyIndexChanged(boolean) abstract to force implementors
to switch to overriding the latter method.  This makes Repository less
error-prone to extend since implementors no longer need to remember to
override one of those two methods.

Change-Id: I721db0f4a4865db3b35212ee0a2045d5b31c96af
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-05-18 09:22:30 -07:00
Jonathan Nieder ca79b3d4af Revive Repository#notifyIndexChanged()
e9e150fdd2 (Store in IndexChangedEvent if it was caused by JGit
itself, 2018-05-13) modified Repository#notifyIndexChanged to take a
boolean argument to indicate whether the index change happened under
the current process's control or externally, for use by EGit.  In
other words, the function signature changed from

	public abstract void notifyIndexChanged();

to

	public abstract void notifyIndexChanged(boolean internal);

Callers outside JGit itself notifying a Repository about index changes
are expected to be rare, so this is not very disruptive to them.  In
most cases they would be notifying about changes that they made
themselves, so treating their notifyIndexChanged() calls as
notifyIndexChanged(true) should be relatively safe.

Implementors have the opposite problem: adding the new "abstract void
notifyIndexChanged(boolean)" method means they are obligated to
override it.  Add a default implementation that calls their existing
override of notifyIndexChanged() to make their migration easier.

The main downside is that authors of new Repository subclasses that
do not realize they need to override notifyIndexChanged would end up
with a default implementation which calls notifyIndexChanged(true),
in turn calling notifyIndexChanged() again and so on, resulting in
StackOverflowException.  Add an implementors' note to the class
Javadoc to avoid this issue.  A followup commit will force
implementors to adapt to the new API by changing the methods to

	@Deprecated
	public final void notifyIndexChanged() {
		notifyIndexChanged(true);
	}

	public abstract void notifyIndexChanged(boolean internal);

Change-Id: I7d014890ee19abf283ea824d9baa9044bfdde130
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-05-18 09:15:30 -07:00
Han-Wen Nienhuys f3ec7cf3f0 Remove further unnecessary 'final' keywords
Remove it from

 * package private functions.

 * try blocks

 * for loops

this was done with the following python script:

$ cat f.py
import sys
import re
import os

def replaceFinal(m):
  return m.group(1) + "(" +  m.group(2).replace('final ', '') + ")"

methodDecl = re.compile(r"^([\t ]*[a-zA-Z_ ]+)\(([^)]*)\)")

def subst(fn):
  input = open(fn)
  os.rename(fn, fn + "~")

  dest = open(fn, 'w')
  for l in input:
    l = methodDecl.sub(replaceFinal, l)
    dest.write(l)
  dest.close()


for root, dirs, files in os.walk(".", topdown=False):
  for f in files:
    if not f.endswith('.java'):
      continue

    full = os.path.join(root, f)
    print full
    subst(full)

Change-Id: If533a75a417594fc893e7c669d2c1f0f6caeb7ca
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2018-05-18 17:59:45 +02:00
Masaya Suzuki 667e30678a Execute AdvertiseRefsHook only for protocol v0 and v1
Refs are not advertised as part of the protocol v2 capability
advertisement. Don't call AdvertiseRefsHook.

Noticed because many implementations of AdvertiseRefsHook read all
refs in order to call UploadPack#setAdvertisedRefs, causing the
capability advertisement to be as slow as a v0 ref advertisement with
some RefDatabase implementations.

Such an AdvertiseRefsHook is of dubious utility (a better place to
determine which refs are advertised is in the RefDatabase
implementation itself, as in Gerrit), but at any rate since it's not
bringing about any benefit here, we can skip the hook call.

TODO:
- call an appropriate hook instead (https://bugs.eclipse.org/534847)
- add tests

[jn: fleshed out commit message; added TODO notes]

Change-Id: I6eb60ccfb251a45432954467a9ae9c1079a8c8b5
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-05-17 19:15:40 -07:00
Jonathan Tan 2841bab938 Add protocol v2 support in "jgit daemon"
With this patch, a server spawned by "jgit daemon" can be accessed using
protocol v2 from a Git client that supports it (for example, "git" with
the appropriate patches). This is only activated if the repository's
config has "protocol.version" be 2.

This required a change to the package-private #execute methods in
DaemonService to allow passing of extra parameters.

This has been tested with a patched Git.

Change-Id: Icf043efec7ce956d72b075fc6dc7a87d5a2da82a
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
2018-05-16 20:58:31 -04:00
Jonathan Tan 526f5cf984 Teach UploadPack "ofs-delta" in "fetch"
Add support for the "ofs-delta" parameter in the "fetch" command in
the fetch-pack/upload-pack protocol v2.

Change-Id: I728cf986082fce4ddeb6a6435897692e15e60cc7
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
2018-05-16 20:54:03 -04:00
Jonathan Tan 5a87d50408 Teach UploadPack "include-tag" in "fetch"
Add support for the "include-tag" parameter in the "fetch" command in
the fetch-pack/upload-pack protocol v2.

In order to determine which tags to include, only objects pointed to by
refs starting with "refs/tags/" are checked. This restriction is for
performance reasons and to match the behavior of Git (see add_ref_tag()
in builtin/pack-objects.c).

Change-Id: I7d70aa09bcc8a525218ff1559e286c2a610258ca
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-05-16 17:16:35 -07:00
Jonathan Tan c79e7f1c27 Avoid using #refs in UploadPack#sendPack
When OPTION_INCLUDE_TAG is set, UploadPack#sendPack uses the #refs
instance variable as a source of information of tags. A subsequent patch
will need to supply this information to #sendPack without
modifying #refs, so refactor #sendPack to take in this information
through a parameter instead.

Note that prior to this patch, #refs was used twice in #sendPack: once
to generate the argument to PackWriter#setTagTargets, and once to
determine if any tags need to be included in the packfile. This patch
only updates the latter use, since the former is meant not only for
"true" tag targets but any object that should be hoisted earlier during
packing (see the documentation of PackWriter#setTagTargets).

This patch does not introduce any functionality change.

Change-Id: I70ed65a1041334abeda8d4bac98cce7cae7efcdf
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-05-16 16:57:54 -07:00
Matthias Sohn 5797105754 Prepare 5.0.0-SNAPSHOT builds
Change-Id: I65d7d74c6124507aa9cb2856c74db6a1a6935bab
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-05-16 22:23:51 +02:00
Matthias Sohn a8aabc3d15 JGit v5.0.0.201805151920-m7
Change-Id: I42eb046c8ac8537672010aabe21459293cb23838
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-05-16 01:20:14 +02:00
David Pursehouse 1046ba12f9 FileRepository: Don't use deprecated RefDatabase#getRefs(String)
Change-Id: Iec58c973537ddbe0f4e6b8b62fcda5cecc961661
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-05-15 18:04:08 -04:00
David Pursehouse 46b7128a2e BatchRefUpdate: Don't use deprecated RefDatabase#getRefs(String)
Change-Id: I672c9cfe221ddc4acbde7a8040bd6ba83b16626e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-05-15 18:02:39 -04:00
Han-Wen Nienhuys 6d370d837c Remove 'final' in parameter lists
Change-Id: Id924f79c8b2c720297ebc49bf9c5d4ddd6d52547
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2018-05-15 17:05:02 -04:00
Han-Wen Nienhuys f6873ffe52 Fixup javadoc and formatting in RawText and RawParseUtils
Change-Id: I9d6002941a33ec204d29e4fd920dde965387bb24
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2018-05-14 17:42:03 -07:00
Jonathan Nieder 7d9246f163 RawParseUtils#lineMap: Simplify by using null sentinel internally
Add an internal lineMapOrNull helper that returns null when the file
is binary.

This is simpler than using an exception for control flow and avoids
having to override fillInStackTrace to avoid a performance regression.

Change-Id: Ib8bb8df6a6bbd60c62cfb3b4c484a962a98b7507
2018-05-14 09:02:44 -07:00
Matthias Sohn e9e150fdd2 Store in IndexChangedEvent if it was caused by JGit itself
This allows to differentiate if index was changed by an external git
command or by JGit itself.

Change-Id: Iae692ba7d9bf01a288b3fb2dc2d07aec9891c712
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-05-13 22:38:54 +02:00
Han-Wen Nienhuys 08d2e0188c Introduce new RawText constructor and RawParseUtils.lineMapOrBinary
This makes binary detection exact in ResolveMerger and DiffFormatter

This has the same intention as
Id4342a199628d9406bfa04af1b023c27a47d4014 but preserves backward
compatibility of the signature of RawParseUtils.lineMap.

Change-Id: Ia24a4e716592bab3363ae24e3a46315a7511154f
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-05-12 10:18:37 +02:00