]> source.dussan.org Git - jgit.git/log
jgit.git
11 years agoDo not close ArchiveOutputStream on error 09/16709/4
Jonathan Nieder [Tue, 24 Sep 2013 00:06:18 +0000 (17:06 -0700)]
Do not close ArchiveOutputStream on error

If we encounter an I/O error while writing an archive (for example due
to the reader of an HTTP stream closing the connection), the result is
an archive with unclosed entries, causing
TarArchiveOutputStream.finish() to throw IOException("This archives
contains unclosed entries"), hiding the IOException that caused the
early termination.

The unclosed entries are fine: the same exception that occured in the
first place will probably prevent closing the entries before finishing
this partial archive that should be discarded anyway.

It would be nicer to call TarArchiveOutputStream.finish and leave the
underlying OutputStream unclosed --- all callers close it already ---
but that would be a more invasive change so we hold off for now.

Change-Id: I328ced19aa8a1888e5353cdbb6106a85fd72d5d7
Signed-off-by: Jonathan Nieder <jrn@google.com>
11 years agoIgnore bitmap indexes that do not match the pack checksum 18/16618/4
Colby Ranger [Thu, 19 Sep 2013 21:33:13 +0000 (14:33 -0700)]
Ignore bitmap indexes that do not match the pack checksum

If `git gc` creates a new pack with the same file name, the
pack checksum may not match that in the .bitmap. Fix the PackFile
implementaion to silently ignore invalid bitmap indexes.

Fixes Issue https://code.google.com/p/gerrit/issues/detail?id=2131

Change-Id: I378673c00de32385ba90f4b639cb812f9574a216

11 years agoMerge branch 'stable-3.0' 03/16503/1
Matthias Sohn [Tue, 17 Sep 2013 13:08:55 +0000 (15:08 +0200)]
Merge branch 'stable-3.0'

* stable-3.0:
  JGit v3.0.3.201309161630-r
  Add org.eclipse.jgit.java7.source to jgit source feature

Change-Id: I738afcfbc78ea1ac56d0d0ab7d4f7717167dd8dd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoJGit v3.0.3.201309161630-r 83/16483/1 stable-3.0 v3.0.3.201309161630-r
Matthias Sohn [Mon, 16 Sep 2013 20:29:58 +0000 (22:29 +0200)]
JGit v3.0.3.201309161630-r

Change-Id: I73ff609ba681500394b5919f62cff9ec24a52756
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoRemove unneeded packs when compacting with no new objects
Colby Ranger [Mon, 16 Sep 2013 18:56:02 +0000 (11:56 -0700)]
Remove unneeded packs when compacting with no new objects

Previously, the DfsPackCompactor exited without pruning the existing
packs, when no new packs were created.

Change-Id: I5e3b6f8c789706c7a982e6ae93cf7c3d4346797c

11 years agoAdd org.eclipse.jgit.java7.source to jgit source feature 57/16457/1
Matthias Sohn [Mon, 16 Sep 2013 09:19:43 +0000 (11:19 +0200)]
Add org.eclipse.jgit.java7.source to jgit source feature

Change-Id: Ifd9153f77c246a67d5d15734667dc2360718a390
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoResetCommand: Allow reset on unborn branch when ref not specified 64/15364/3
Robin Stocker [Mon, 12 Aug 2013 13:13:03 +0000 (15:13 +0200)]
ResetCommand: Allow reset on unborn branch when ref not specified

In C Git 1.8.2, "git reset" now also works on an unborn branch (no HEAD
yet) if no explicit ref was specified. In that case, it is treated as a
reset to an empty tree.

This can be useful for callers because "unborn branch" no longer has to
be special-cased to "git rm --cached".

Bug: 414870
Change-Id: Ied750116f767518ae4d48823cf00752b049a8477
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge branch 'stable-3.0' 47/16347/1
Matthias Sohn [Wed, 11 Sep 2013 21:14:42 +0000 (23:14 +0200)]
Merge branch 'stable-3.0'

* stable-3.0:
  Prepare post 3.0.2 builds
  JGit v3.0.2.201311090911-r

Change-Id: I99a7d1072285646f7fcd4169225c1fd249ad5e37
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoPrepare post 3.0.2 builds 31/16331/1
Matthias Sohn [Wed, 11 Sep 2013 14:51:47 +0000 (16:51 +0200)]
Prepare post 3.0.2 builds

Change-Id: Ie1bd951a2cb35d069c94dab4a62507115913764f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoJGit v3.0.2.201311090911-r 18/16318/1 v3.0.2.201311090911-r
Matthias Sohn [Wed, 11 Sep 2013 13:15:00 +0000 (15:15 +0200)]
JGit v3.0.2.201311090911-r

Change-Id: Ifaae2e3e2f1bb0504bf9e6d59983086ac19a540b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoDon't treat "/" as valid ignore pattern 55/15955/2
Robin Stocker [Wed, 28 Aug 2013 20:57:37 +0000 (22:57 +0200)]
Don't treat "/" as valid ignore pattern

This matches the behavior of C Git.

Bug: 415767
Change-Id: Ifa6500f3f6a033da40c48287630b77c47b15f4a0
Signed-off-by: Robin Stocker <robin@nibor.org>
11 years agoMerge "Add missing usage texts for JGit commandline commands"
Matthias Sohn [Mon, 9 Sep 2013 21:04:58 +0000 (17:04 -0400)]
Merge "Add missing usage texts for JGit commandline commands"

11 years agoAdd missing usage texts for JGit commandline commands 99/13999/5
Matthias Sohn [Sat, 22 Jun 2013 00:19:08 +0000 (02:19 +0200)]
Add missing usage texts for JGit commandline commands

Also update help text for the merge command now supporting recursive
strategy as the default merge strategy.

Change-Id: I07886fe875c407e2244f562c003bb9d04f398026
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdd missing dependency for testing ArchiveCommand with xz compression 12/16212/1
Matthias Sohn [Mon, 26 Aug 2013 14:38:42 +0000 (16:38 +0200)]
Add missing dependency for testing ArchiveCommand with xz compression

Without this dependency the ArchiveTest.testTxzExtension() fails with a
ClassNotFoundException if it is started from Eclipse.

Change-Id: Ief2fceaaffab7641ba63ace4577462fa3bbf1c13
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge "Remove unnecessary inflate stride in DfsBlock"
Shawn Pearce [Wed, 4 Sep 2013 23:13:55 +0000 (19:13 -0400)]
Merge "Remove unnecessary inflate stride in DfsBlock"

11 years agoRemove unnecessary inflate stride in DfsBlock 36/16136/3
Shawn Pearce [Wed, 4 Sep 2013 19:56:38 +0000 (12:56 -0700)]
Remove unnecessary inflate stride in DfsBlock

OpenJDK 7 does not benefit from using an inflate stride on the input
array. The implementation of java.util.zip.Inflater supplies the
entire input byte[] to libz, with no regards for the bounds supplied.
Slicing at 512 byte increments in DfsBlock no longer has any benefit.

In OpenJDK 6 the native portion of Inflater used GetByteArrayRegion
to obtain a copy of the input buffer for libz. In this use case
supplying a small stride made sense, it avoided allocating space
for and copying data past the end of the object's compressed stream.

In OpenJDK 7 the native code uses GetPrimitiveArrayCritical,
which tries to avoid copying by freezing Java garbage collection
and accessing the byte[] contents in place. On OpenJDK 7 derived
JVMs it is likely more efficient to supply the entire DfsBlock.

Since OpenJDK 5 and 6 are deprecated and replaced by OpenJDK 7
it is reasonable to suggest any consumers running JGit with DFS
support use an OpenJDK 7 derived JVM. However, JGit still targets
local filesystem support on Java 5, so it is still not reasonble to
apply this same simplification to the internal.storage.file package.

See: JDK-6751338 (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6751338)
Change-Id: Ib248b6d383da5c8aa887d9c355a0df6f3e2247a5

11 years agoMerge branch 'stable-3.0' 38/16138/1
Matthias Sohn [Wed, 4 Sep 2013 20:45:53 +0000 (22:45 +0200)]
Merge branch 'stable-3.0'

* stable-3.0:
  Prepare post 3.0.2-rc2 builds
  JGit v3.0.2.201309041250-rc2
  Uncomment eclipse-jar-signer plugin
  Update build to use CBI jarsigner plugin
  Update maven plugins
  Update to Orbit Kepler SR1 release R20130827064939

Change-Id: Iaa8bba21c300dd1de2b91a77cddf6727fbc66340
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoPrepare post 3.0.2-rc2 builds 28/16128/1
Matthias Sohn [Wed, 4 Sep 2013 17:34:24 +0000 (19:34 +0200)]
Prepare post 3.0.2-rc2 builds

Change-Id: I0e4020326c6443ba7157c18b345160cf9e1e88a7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoJGit v3.0.2.201309041250-rc2 22/16122/1 v3.0.2.201309041250-rc2
Matthias Sohn [Wed, 4 Sep 2013 16:55:13 +0000 (18:55 +0200)]
JGit v3.0.2.201309041250-rc2

Change-Id: Ie18ced75f573f140969af2a7d9edb45c76523715
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoUncomment eclipse-jar-signer plugin 15/16115/1
Matthias Sohn [Wed, 4 Sep 2013 15:05:33 +0000 (17:05 +0200)]
Uncomment eclipse-jar-signer plugin

This was commented out by mistake.

Change-Id: Ia1f6518ab7c7466d11710225f815b755fbf4d387
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoUpdate build to use CBI jarsigner plugin 21/15921/21
Matthias Sohn [Fri, 30 Aug 2013 22:26:18 +0000 (00:26 +0200)]
Update build to use CBI jarsigner plugin

The dash signing plugin has been retired hence we need to update our
build to use the CBI jarsigner plugin for signing build results.

Pack test classes to enable signing them.

Also re-enable pack200 for bundle org.eclipse.jgit.

WORKAROUND: there is no easy way to run tests with maven-surefire-plugin
from signed test-jar so for a quick workaround we will have to add a
build step on Hudson so that we can run tests before signing:
- first step will do "clean, verify" to compile and run tests
- second step will do "install, deploy" with profile "eclipse-sign" and
  use -DskipTests=true to skip tests since they would hit a
  SecurityException when unsigned test classes are in same package as
  signed classes under test
- third step will do "clean, install, deploy" on packaging reactor to
  build features and p2 repository with profile "eclipse-sign" to sign
  and pack200 all bundles.

TODO: Tycho doesn't suport picking up pack200 artifacts via
pomDependencies hence we need to find a way to copy them manually and
use tycho-extra's tycho-p2-extras-plugin:publish-features-and-bundles
to generate the missing p2 metadata.

Change-Id: Iec2c5ab3027a3e3f9ecc0d2f99193385177d9025
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoUpdate maven plugins 17/16017/1
Matthias Sohn [Fri, 30 Aug 2013 21:09:12 +0000 (23:09 +0200)]
Update maven plugins

Change-Id: Idda470ff355cc1ab559c3c64189e8b1df173dc55
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoUpdate to Orbit Kepler SR1 release R20130827064939 18/15918/1
Matthias Sohn [Tue, 27 Aug 2013 22:13:03 +0000 (00:13 +0200)]
Update to Orbit Kepler SR1 release R20130827064939

Change-Id: I6849fc5cb81e8ac47ce1b2c5a74737b23c089fc1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoLogCommand: Remove outdated TODO and improve docs 40/15540/2
Robin Stocker [Fri, 16 Aug 2013 13:38:43 +0000 (15:38 +0200)]
LogCommand: Remove outdated TODO and improve docs

Change-Id: I368be12e7bdc3c711e9f474ead312006513764b7
Signed-off-by: Robin Stocker <robin@nibor.org>
11 years agoMerge branch 'stable-3.0' 09/15809/1
Matthias Sohn [Thu, 22 Aug 2013 20:50:43 +0000 (22:50 +0200)]
Merge branch 'stable-3.0'

* stable-3.0:
  Update reflog like C Git during rebase (non-interactive)
  Make sure checkout is not deleting folders outside the workingtree
  Update to Jetty 7.6.11.v20130520
  Fix bugs in TreeWalk#isPathSuffix used by PathSuffixFilter
  Refactor PathSuffixFilterTest to remove duplication
  Check parentFile is not null
  Update HEAD in cherry-picking several commits
  Fix HTTP response processing for WWW-Authenticate headers
  Don't skip want validation when the client sends no haves
  Fix tests for OS X when the tmpdir is the default /tmp
  Fix running maven http tests on OS X
  Recognize CRLF when parsing the short message of a commit or tag
  Update build to use Tycho 0.18
  Add jgit target platform to define dependencies more precisely
  Prepare 3.0.2-SNAPSHOT builds

Change-Id: Icef0cd0cce9bbccf2b2cbb3471a3f4ce0655e22c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoUpdate reflog like C Git during rebase (non-interactive) 82/15582/2
Robin Rosenberg [Sun, 5 May 2013 23:39:25 +0000 (01:39 +0200)]
Update reflog like C Git during rebase (non-interactive)

Bug: 346350
Change-Id: I119766a00bc52a810c51cffaa19207cb8555ca22
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
11 years agoMake sure checkout is not deleting folders outside the workingtree 81/15581/2
Christian Halstrick [Mon, 9 Jan 2012 15:15:12 +0000 (16:15 +0100)]
Make sure checkout is not deleting folders outside the workingtree

There was a chance that jgit deletes symbolic links which point to the
folder on top of the working tree. Make sure not to touch these
resources.

Thanks to Cedric Darloy who reported this bug on
http://www.eclipse.org/forums/index.php/m/776910/#msg_776910 and to
Ondrej Vrabec who reported bug 412489.

Bug: 412489
Change-Id: I81735ba0394ef6794e9b2b8bdd8bd7e8b9c6460f
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Robin Stocker <robin@nibor.org>
11 years agoUpdate to Jetty 7.6.11.v20130520 09/15709/1
Matthias Sohn [Thu, 4 Jul 2013 22:06:05 +0000 (00:06 +0200)]
Update to Jetty 7.6.11.v20130520

Change-Id: I76d32444c9cf9f086a013e410a88d37a359272fd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoFix bugs in TreeWalk#isPathSuffix used by PathSuffixFilter 08/15708/1
Robin Stocker [Mon, 8 Jul 2013 08:51:52 +0000 (10:51 +0200)]
Fix bugs in TreeWalk#isPathSuffix used by PathSuffixFilter

* It didn't check the first character in the pattern due to a off-by-one
  error. Spotted by James Roper.
* It returned true even when pattern was longer than current path, e.g.
  it returned that ".txt" is suffix of "txt".

Bug: 411999
Change-Id: I9fbcd68a11fb57cc49956b70c387a47271a0424f
Signed-off-by: Robin Stocker <robin@nibor.org>
11 years agoRefactor PathSuffixFilterTest to remove duplication 07/15707/1
Robin Stocker [Mon, 8 Jul 2013 08:48:45 +0000 (10:48 +0200)]
Refactor PathSuffixFilterTest to remove duplication

Makes it possible to add new test cases without copying lots of lines.

Change-Id: I66db3bc0cbd18fb5a07748905c60384b86b1c162
Signed-off-by: Robin Stocker <robin@nibor.org>
11 years agoCheck parentFile is not null 06/15706/1
Hiroshi Tomita [Fri, 5 Jul 2013 00:04:00 +0000 (09:04 +0900)]
Check parentFile is not null

parentFile becomes null when f is relative path, such as ".".

This patch avoids NullPointerException in such case.

Change-Id: I4752674b1daab6eedd7c3650c7749462810eaffd
Signed-off-by: Hiroshi Tomita <tomykaira@gmail.com>
11 years agoUpdate HEAD in cherry-picking several commits 80/15580/2
Hiroshi Tomita [Sun, 30 Jun 2013 16:07:10 +0000 (01:07 +0900)]
Update HEAD in cherry-picking several commits

Without update, index is wrongly detected to be dirty
when picking the second commit.

Change-Id: Idf47ecb33e8bd38340d760806d629f67be92d2d5
Signed-off-by: Hiroshi Tomita <tomykaira@gmail.com>
Bug: 411963

11 years agoFix HTTP response processing for WWW-Authenticate headers 79/15579/2
Alex Rukhlin [Wed, 6 Mar 2013 21:35:52 +0000 (16:35 -0500)]
Fix HTTP response processing for WWW-Authenticate headers

The original code was able to process only one WWW-Authenticate
header in an HTTP response, and if this header was not one of
two expected, authentication failed regardless of that there
could be other headers in the response.

All WWW-Authenticate headers in an HTTP response have to be
browsed to find one of supported, i.e. Basic or Digest.
By that if both are present, the Digest one should be used
as more preferable.

Bug: 357719
Change-Id: Icf601a41fec63f7d40308f3c85aaa4f71a7c095b
Signed-off-by: Alex Rukhlin <arukhlin@microsoft.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoDon't skip want validation when the client sends no haves 05/15705/1
Dave Borowitz [Fri, 21 Jun 2013 23:14:30 +0000 (16:14 -0700)]
Don't skip want validation when the client sends no haves

Change-Id: I5e80b3befca5cf1dcb06075862d6d48e6491cc0f

11 years agoFix tests for OS X when the tmpdir is the default /tmp 78/15578/2
Robin Rosenberg [Sun, 16 Jun 2013 10:02:14 +0000 (12:02 +0200)]
Fix tests for OS X when the tmpdir is the default /tmp

/tmp is a symbolic link and some tests break when the path
gets canonicalized by JGit or Jetty. Allow Jetty to serve
symlinks by setting init parameter "aliases" to true [1].

[1] http://wiki.eclipse.org/Jetty/Howto/How_to_serve_symbolically_linked_files

Change-Id: I45359a40435e8a33def6e0bb6784b4d8637793ac
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoFix running maven http tests on OS X 77/15577/2
Robin Rosenberg [Sun, 16 Jun 2013 09:28:36 +0000 (11:28 +0200)]
Fix running maven http tests on OS X

In 36144e12d8 tests were changed to use the system tmp directory as defined
by java.io.tmpdir, which was then overridden in the pom files to usea custom
directory that made som tests work, but not all.

Change-Id: I2fa04878f8830ad9c9b32a6f3fe8d2e2d66fe411

11 years agoRecognize CRLF when parsing the short message of a commit or tag 76/15576/2
Robin Rosenberg [Sat, 30 Mar 2013 10:03:33 +0000 (11:03 +0100)]
Recognize CRLF when parsing the short message of a commit or tag

Bug: 400707
Change-Id: I9b09bb88528af465018fc0278f5441f7e6b75986

11 years agoUpdate build to use Tycho 0.18 04/15704/1
Matthias Sohn [Sat, 1 Jun 2013 22:26:59 +0000 (00:26 +0200)]
Update build to use Tycho 0.18

Change-Id: I66ffb2b6416dbbd5da11ad789dd58060b7ab09f2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdd jgit target platform to define dependencies more precisely 03/15703/1
Matthias Sohn [Fri, 31 May 2013 22:36:17 +0000 (00:36 +0200)]
Add jgit target platform to define dependencies more precisely

Avoid that the packaging build picks an older jgit version coming with
eclipse platform by using a target platform which allows to define the
dependencies more precisely.

Change-Id: I39bba3baa4517e2b5e5fe0de096e756f2904e3e9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoPrepare 3.0.2-SNAPSHOT builds 75/15575/1
Matthias Sohn [Sun, 18 Aug 2013 23:12:10 +0000 (01:12 +0200)]
Prepare 3.0.2-SNAPSHOT builds

Change-Id: I3287609a90f068017cc62f4fd7738651e0663081
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoEnable LsRemoteCommand to work without local repository 26/14726/4
Robin Stocker [Sun, 21 Jul 2013 14:23:12 +0000 (16:23 +0200)]
Enable LsRemoteCommand to work without local repository

It's supported by C Git and can be useful.

Bug: 413388
Change-Id: I12c6c10e791cc09ee271d89eb8b8d32f53e385db
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdd missing @since tag for replaceLineBreaksWithSpace 84/15384/1
Robin Stocker [Mon, 12 Aug 2013 19:34:50 +0000 (21:34 +0200)]
Add missing @since tag for replaceLineBreaksWithSpace

Change-Id: Ibd9d9ba609a2cd7707b985cdb07405dce0422aab
Signed-off-by: Robin Stocker <robin@nibor.org>
11 years agoAllow the command line bundle to access internal jgit packages 96/13996/2
Matthias Sohn [Fri, 21 Jun 2013 23:11:25 +0000 (01:11 +0200)]
Allow the command line bundle to access internal jgit packages

Change-Id: Id1e11a21fdcbd8cb0f2f8c22e7ab253e8df65d2f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge "Recognize CRLF when parsing the short message of a commit or tag"
Robin Rosenberg [Sat, 10 Aug 2013 22:31:01 +0000 (18:31 -0400)]
Merge "Recognize CRLF when parsing the short message of a commit or tag"

11 years agoMerge "Added characters to be escaped in file name patterns"
Robin Rosenberg [Sat, 10 Aug 2013 21:32:20 +0000 (17:32 -0400)]
Merge "Added characters to be escaped in file name patterns"

11 years agoAdd missing @since tags 42/15042/9
Lars Vogel [Thu, 25 Jul 2013 21:28:05 +0000 (23:28 +0200)]
Add missing @since tags

Change-Id: I9754e2124c0fe6ad2dbde5597c3ed10f1c3efef5
Signed-off-by: Lars Vogel <Lars.Vogel@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdvertise capabilities with no refs in upload service. 53/15253/2
Colby Ranger [Thu, 8 Aug 2013 14:57:49 +0000 (07:57 -0700)]
Advertise capabilities with no refs in upload service.

With reference hiding, it is possible for a repository to appear
empty when all refs are hidden. This causes capabilities to not be
advertised either, since they are published with the first reference,
breaking fetch by SHA1 support.

Always advertise the capabilites by publishing the symbolic capabilities
reference when the repository has no references to advertise (similar to
the receive service).

Change-Id: I8060e430ee03571dc51239e702864c85e888505c

11 years agoAllow UploadPack requests with no options 27/15227/1
Shawn Pearce [Wed, 7 Aug 2013 22:43:58 +0000 (15:43 -0700)]
Allow UploadPack requests with no options

UploadPack can be invoked with no capabilities selected by the
client if the client is an ancient version of Git that nobody in
their right mind should still be using. Or if the client is very
broken and does not want to use any of the newer features added to
the protocol since its inception.

Change-Id: I3baa6f90e6a41a37a8eab8449a3cc41f4efcb91a

11 years agoAdd --quiet flag to pgm fetch. 49/15149/1
Colby Ranger [Mon, 5 Aug 2013 22:12:57 +0000 (15:12 -0700)]
Add --quiet flag to pgm fetch.

Change-Id: If141fdc5c181b3a618b7e286ad3c6957211d0afc

11 years agoSend no-progress option with NullProgressMonitor. 48/15148/1
Colby Ranger [Mon, 5 Aug 2013 21:33:55 +0000 (14:33 -0700)]
Send no-progress option with NullProgressMonitor.

The NullProgressMonitor does not report progress anywhere. Inform the
server not to send progress by enabling the no-progress capability.

Change-Id: Id18dbc754c814d1a5534a284c947030bf201c569

11 years agoMerge "Change RequestValidator parameter to ObjectId list"
Shawn Pearce [Fri, 2 Aug 2013 22:15:19 +0000 (18:15 -0400)]
Merge "Change RequestValidator parameter to ObjectId list"

11 years agoChange RequestValidator parameter to ObjectId list 98/14898/4
Greg Hill [Fri, 26 Jul 2013 19:08:31 +0000 (12:08 -0700)]
Change RequestValidator parameter to ObjectId list

Instead of RevObject list, this allows a custom request validator to be called
on SHA-1's corresponding to objects that may not exist in repository storage

Change-Id: I19bb667beff0d0c144150a61d7a1dc6c9703be7f
Signed-off-by: Greg Hill <greghill@google.com>
11 years agoAdd setter for ProgressMonitor to StatusCommand 76/14876/5
Christian Trutz [Thu, 25 Jul 2013 21:28:05 +0000 (23:28 +0200)]
Add setter for ProgressMonitor to StatusCommand

This is useful if Git.status() is a long running command.

Change-Id: I6bdbf347a688043d549c1f091fb4a264a6c7024e
Signed-off-by: Christian Trutz <christian.trutz@gmail.com>
Signed-off-by: Robin Stocker <robin@nibor.org>
11 years agoImplement open(URIish) for TransportLocal 25/14725/2
Robin Stocker [Sun, 21 Jul 2013 14:10:54 +0000 (16:10 +0200)]
Implement open(URIish) for TransportLocal

Can be used for listing remote refs for a repository on the file system
without having a local repository.

Bug: 413400
Change-Id: I397f5092c5eafb62236e9f9e74d9183f56903cc6
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
11 years agoFix NPE in openFetch on Transport without local repository 20/14720/3
Robin Stocker [Sat, 20 Jul 2013 14:26:05 +0000 (16:26 +0200)]
Fix NPE in openFetch on Transport without local repository

Setting the walk and other fields to null will result in NPEs when the
user e.g. calls fetch on the connection, but at least the advertised
refs can be read like that without having a local repository.

Bug: 413389
Change-Id: I39c8363e81a1c7e6cb3412ba88542ead669e69ed
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
11 years agoAdd NON-NLS comments for some obviously untranslatable strings 52/12552/3
Robin Rosenberg [Mon, 6 May 2013 19:47:11 +0000 (21:47 +0200)]
Add NON-NLS comments for some obviously untranslatable strings

Change-Id: I2d1076b46695dac84961b8ae663bfc5cb123b3a3
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
11 years agoUpdate reflog like C Git during rebase (non-interactive) 17/12517/5
Robin Rosenberg [Sun, 5 May 2013 23:39:25 +0000 (01:39 +0200)]
Update reflog like C Git during rebase (non-interactive)

Bug: 346350
Change-Id: I119766a00bc52a810c51cffaa19207cb8555ca22
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
11 years agoImprove documentation of PathSuffixFilter 62/14562/2
Robin Stocker [Mon, 15 Jul 2013 15:20:53 +0000 (17:20 +0200)]
Improve documentation of PathSuffixFilter

Change-Id: I1077dbb1f10c7cc687c0d1b8a8e8f763ca96977c
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
11 years agoAdd path option to StatusCommand 98/14698/3
Christian Halstrick [Fri, 19 Jul 2013 11:37:58 +0000 (13:37 +0200)]
Add path option to StatusCommand

Allow filtering of the status. Only files which match given paths are
inspected and only their state is reported.

Change-Id: I3c4b1b46bf297cd4ebdb4997cfa14c8752a36411
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
11 years agoFix MERGED_NOT_COMMITTED toString 65/14665/1
Robin Stocker [Thu, 18 Jul 2013 18:04:47 +0000 (20:04 +0200)]
Fix MERGED_NOT_COMMITTED toString

It had a typo (commited) and was not in the style of the others.

Change-Id: Ia1be1c70b13bb2f3da80c8e8239c5f254070fe60
Signed-off-by: Robin Stocker <robin@nibor.org>
11 years agoTarFormat: use tabs for indent 29/14629/1
Dave Borowitz [Wed, 17 Jul 2013 19:57:35 +0000 (12:57 -0700)]
TarFormat: use tabs for indent

Change-Id: I2f4c285d2b2f4bdb7a5d1a1026c131417066410d

11 years agoClose unfinished archive entries on error 28/14628/1
Jonathan Nieder [Wed, 17 Jul 2013 19:19:12 +0000 (12:19 -0700)]
Close unfinished archive entries on error

Otherwise the underlying error is hidden by an "IOException: This
archives contains unclosed entries." when jgit tries to close the
archive.

Reported-by: Dave Borowitz <dborowitz@google.com>
Change-Id: I594dcdf366200b802e13e5a645fe06597feb7bb4
Signed-off-by: Jonathan Nieder <jrn@google.com>
11 years agoMerge "Add missing @since tags"
Matthias Sohn [Fri, 12 Jul 2013 22:09:22 +0000 (18:09 -0400)]
Merge "Add missing @since tags"

11 years agoMerge "Fix bugs in TreeWalk#isPathSuffix used by PathSuffixFilter"
Christian Halstrick [Thu, 11 Jul 2013 06:32:37 +0000 (02:32 -0400)]
Merge "Fix bugs in TreeWalk#isPathSuffix used by PathSuffixFilter"

11 years agoAdd missing @since tags 65/14465/1
Matthias Sohn [Wed, 10 Jul 2013 22:18:48 +0000 (00:18 +0200)]
Add missing @since tags

Change-Id: I6f672249d7ca014c63fb939cd0836689eb27ab90
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdd tests for DirCacheCheckout and symlinks 42/14442/3
Christian Halstrick [Mon, 9 Jan 2012 15:15:12 +0000 (16:15 +0100)]
Add tests for DirCacheCheckout and symlinks

DirCacheCheckout had a bug when the parentdirectory of a worktree was a
symlink. DirCacheCheckout was deleting those symlinks under certain
conditions. This was fixed in I81735ba0394ef6794e9b2b8bdd8bd7e8b9c6460f
without a test because previously it was hard to setup tests containing
symlinks.

BUG: 412489
Change-Id: I2513166af519d6fc01d1eae3976ad6cff6f98530
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge changes If386fe25,I52a17499,Id12e7f00,I264e028a,I0d52af8a,I0d0cc4f8
Dave Borowitz [Wed, 10 Jul 2013 18:50:41 +0000 (14:50 -0400)]
Merge changes If386fe25,I52a17499,Id12e7f00,I264e028a,I0d52af8a,I0d0cc4f8

* changes:
  UploadPack: allow custom RequestValidator instances
  UploadPack: refactor want validation
  UploadPack: set RefFilter from TransportConfig
  UploadPack: configure RequestPolicy with TransportConfig
  UploadPack: advertise allow-tip-sha1-in-want
  Add RequestPolicy.TIP to allow fetching non-advertised ref tips

11 years agoMake sure checkout is not deleting folders outside the workingtree 35/4935/2
Christian Halstrick [Mon, 9 Jan 2012 15:15:12 +0000 (16:15 +0100)]
Make sure checkout is not deleting folders outside the workingtree

There was a chance that jgit deletes symbolic links which point to the
folder on top of the working tree. Make sure not to touch these
resources.

Thanks to Cedric Darloy who reported this bug on
http://www.eclipse.org/forums/index.php/m/776910/#msg_776910 and to
Ondrej Vrabec who reported bug 412489.

Bug: 412489
Change-Id: I81735ba0394ef6794e9b2b8bdd8bd7e8b9c6460f
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Robin Stocker <robin@nibor.org>
11 years agoUpdate to Jetty 7.6.11.v20130520 73/14373/1
Matthias Sohn [Thu, 4 Jul 2013 22:06:05 +0000 (00:06 +0200)]
Update to Jetty 7.6.11.v20130520

Change-Id: I76d32444c9cf9f086a013e410a88d37a359272fd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoFix bugs in TreeWalk#isPathSuffix used by PathSuffixFilter 47/14347/2
Robin Stocker [Mon, 8 Jul 2013 08:51:52 +0000 (10:51 +0200)]
Fix bugs in TreeWalk#isPathSuffix used by PathSuffixFilter

* It didn't check the first character in the pattern due to a off-by-one
  error. Spotted by James Roper.
* It returned true even when pattern was longer than current path, e.g.
  it returned that ".txt" is suffix of "txt".

Bug: 411999
Change-Id: I9fbcd68a11fb57cc49956b70c387a47271a0424f
Signed-off-by: Robin Stocker <robin@nibor.org>
11 years agoRefactor PathSuffixFilterTest to remove duplication 57/14357/1
Robin Stocker [Mon, 8 Jul 2013 08:48:45 +0000 (10:48 +0200)]
Refactor PathSuffixFilterTest to remove duplication

Makes it possible to add new test cases without copying lots of lines.

Change-Id: I66db3bc0cbd18fb5a07748905c60384b86b1c162
Signed-off-by: Robin Stocker <robin@nibor.org>
11 years agoCheck parentFile is not null 93/14293/1
Hiroshi Tomita [Fri, 5 Jul 2013 00:04:00 +0000 (09:04 +0900)]
Check parentFile is not null

parentFile becomes null when f is relative path, such as ".".

This patch avoids NullPointerException in such case.

Change-Id: I4752674b1daab6eedd7c3650c7749462810eaffd
Signed-off-by: Hiroshi Tomita <tomykaira@gmail.com>
11 years agoUploadPack: allow custom RequestValidator instances 03/14003/7
Dave Borowitz [Mon, 24 Jun 2013 00:28:34 +0000 (17:28 -0700)]
UploadPack: allow custom RequestValidator instances

Make the existing concrete implementations public as well so custom
implementations may delegate to them where appropriate. Treat all custom
implementations as providing allow-tip-sha1 in want.

Change-Id: If386fe25c0d3b4551a97c16a22350714453b03e9

11 years agoUploadPack: refactor want validation 02/14002/4
Dave Borowitz [Mon, 24 Jun 2013 00:02:29 +0000 (17:02 -0700)]
UploadPack: refactor want validation

Associate each RequestPolicy with an implementation of a
RequestValidator interface that contains the validation logic. The
checkWants method is only called if there are wants that were not
advertised, since clients may always request any advertised want
according to the git protocol. Calling the method only once at the
end of parsing the want list also means policy implementations can be
stateful, unlike the previous switch statement inside a loop.

For the special handling of unidirectional pipes, simply check
isBiDirectional() and delegate to other implementations if necessary.

Change-Id: I52a174999ac3a5aca46d3469cb0b81edd1710580

11 years agoUploadPack: set RefFilter from TransportConfig 00/13900/7
Dave Borowitz [Tue, 18 Jun 2013 23:41:58 +0000 (16:41 -0700)]
UploadPack: set RefFilter from TransportConfig

Teach TransportConfig to respect uploadpack.hiderefs, which is new in
C git 1.8.2.

Change-Id: Id12e7f00b9a60258e996410f67fa10616459f53f

11 years agoUploadPack: configure RequestPolicy with TransportConfig 99/13899/7
Dave Borowitz [Tue, 18 Jun 2013 22:31:17 +0000 (15:31 -0700)]
UploadPack: configure RequestPolicy with TransportConfig

C git 1.8.2 supports setting the equivalent of RequestPolicy.TIP with
uploadpack.allowtipsha1. Parse this into TransportConfig and use it
from UploadPack. An explicitly set RequestPolicy overrides the config,
and the policy may still be upgraded on a unidirectional connection to
avoid races.

Defer figuring out the effective RequestPolicy to later in the
process. This is a minor semantic change to fix a bug: previously,
calling setRequestPolicy(ADVERTISED) _after_ calling
setBiDirectionalPipe(true) would have reintroduced the race condition
otherwise fixed by 01888db892aa9590862d886c01f3b293140db153.

Change-Id: I264e028a76574434cecb34904d9f5944b290df78

11 years agoUploadPack: advertise allow-tip-sha1-in-want 98/13898/7
Dave Borowitz [Tue, 18 Jun 2013 22:07:19 +0000 (15:07 -0700)]
UploadPack: advertise allow-tip-sha1-in-want

This protocol capability, new in C git 1.8.2, corresponds to
RequestPolicy.TIP, so advertise it if that request policy was set.

Change-Id: I0d52af8a7747e951a87f060a5124f822ce1b2b26

11 years agoAdd RequestPolicy.TIP to allow fetching non-advertised ref tips 97/13897/6
Dave Borowitz [Tue, 18 Jun 2013 21:58:44 +0000 (14:58 -0700)]
Add RequestPolicy.TIP to allow fetching non-advertised ref tips

Users of UploadPack may set a custom RefFilter or AdvertisedRefsHook
that limits which refs are advertised, but clients may learn of a
SHA-1 that the server should have as a ref tip through some
alternative means. Support serving such objects from the server side
with a new RequestPolicy.

As with ADVERTISED, we need a special relaxed RequestPolicy to allow
commits reachable from the set of valid tips for unidirectional
connections.

Change-Id: I0d0cc4f8ee04d265e5be8221b9384afb1b374315

11 years agoMerge "Update HEAD in cherry-picking several commits"
Robin Stocker [Tue, 2 Jul 2013 11:12:32 +0000 (07:12 -0400)]
Merge "Update HEAD in cherry-picking several commits"

11 years agoUse a bucket sort for PackReverseIndex. 54/14154/3
Colby Ranger [Fri, 28 Jun 2013 17:37:56 +0000 (10:37 -0700)]
Use a bucket sort for PackReverseIndex.

Previously it took 1200ms to create a reverse index (sorted by offset).
Using a simple bucket sort algorithm, that time is reduced to 450ms.
The bucket index into the offset array is kept, in order to decrease
the binary search window.

Don't keep a copy of the offsets. Instead, use nth position
to lookup the offset in the PackIndex.

Change-Id: If51ab76752622e04a4430d9a14db95ad02f5329d

11 years agoUpdate HEAD in cherry-picking several commits 64/14164/3
Hiroshi Tomita [Sun, 30 Jun 2013 16:07:10 +0000 (01:07 +0900)]
Update HEAD in cherry-picking several commits

Without update, index is wrongly detected to be dirty
when picking the second commit.

Change-Id: Idf47ecb33e8bd38340d760806d629f67be92d2d5
Signed-off-by: Hiroshi Tomita <tomykaira@gmail.com>
Bug: 411963

11 years agoImplement get nth offset in PackIndex. 53/14153/2
Colby Ranger [Fri, 28 Jun 2013 21:02:26 +0000 (14:02 -0700)]
Implement get nth offset in PackIndex.

Currently, the offset can only be retrieved by ObjectId or iterating all
of the entries. Add a method to lookup the offset by position in the
index sorted by SHA1.

Change-Id: I45e9ac8b752d1dab47b202753a1dcca7122b958e

11 years agoMerge "Add missing @since tag"
Matthias Sohn [Wed, 26 Jun 2013 23:35:42 +0000 (19:35 -0400)]
Merge "Add missing @since tag"

11 years agoMerge "Move gc to package org.eclipse.jgit.pgm"
Christian Halstrick [Mon, 24 Jun 2013 09:32:59 +0000 (05:32 -0400)]
Merge "Move gc to package org.eclipse.jgit.pgm"

11 years agoFix HTTP response processing for WWW-Authenticate headers 85/13285/2
Alex Rukhlin [Wed, 6 Mar 2013 21:35:52 +0000 (16:35 -0500)]
Fix HTTP response processing for WWW-Authenticate headers

The original code was able to process only one WWW-Authenticate
header in an HTTP response, and if this header was not one of
two expected, authentication failed regardless of that there
could be other headers in the response.

All WWW-Authenticate headers in an HTTP response have to be
browsed to find one of supported, i.e. Basic or Digest.
By that if both are present, the Digest one should be used
as more preferable.

Bug: 357719
Change-Id: Icf601a41fec63f7d40308f3c85aaa4f71a7c095b
Signed-off-by: Alex Rukhlin <arukhlin@microsoft.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoDon't skip want validation when the client sends no haves 97/13997/1
Dave Borowitz [Fri, 21 Jun 2013 23:14:30 +0000 (16:14 -0700)]
Don't skip want validation when the client sends no haves

Change-Id: I5e80b3befca5cf1dcb06075862d6d48e6491cc0f

11 years agoMove gc to package org.eclipse.jgit.pgm 95/13995/1
Matthias Sohn [Fri, 21 Jun 2013 22:57:26 +0000 (00:57 +0200)]
Move gc to package org.eclipse.jgit.pgm

All bugs reported for gc have been fixed and it seems we reached a
stable implementation.

Change-Id: I78a96ee2103beb48325da0f6ee10b2498bdc0267
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdd missing @since tag 43/13943/1
Matthias Sohn [Thu, 20 Jun 2013 07:52:11 +0000 (09:52 +0200)]
Add missing @since tag

Change-Id: I80cfc3e81d5cebf810f36ddf2760aee955c6f50a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoRemove fix-headers and rewrite-history 38/13938/1
Shawn Pearce [Wed, 19 Jun 2013 22:29:15 +0000 (15:29 -0700)]
Remove fix-headers and rewrite-history

These scripts were created to bootstrap the initial contribution for
Eclipse using information from the pre-Eclipse history. We are well
past the point where the project will rewrite history in order to
correct copyright statements, so these tools no longer make sense
to keep in the tip of the tree.

Change-Id: If68419ead0766035d17a21a53a3e5e761eaa70c4

11 years agoAdd a method to DfsOutputStream to read as an InputStream 21/12421/5
Dave Borowitz [Tue, 30 Apr 2013 21:40:11 +0000 (14:40 -0700)]
Add a method to DfsOutputStream to read as an InputStream

Change-Id: I0ec1f17a88bc14f22c10f9bc8d6f5b5118410e3a

11 years agoAdd the other test launchers as favorites 46/13846/2
Robin Rosenberg [Sun, 16 Jun 2013 10:03:04 +0000 (12:03 +0200)]
Add the other test launchers as favorites

The user may not see them otherwise

Change-Id: I43b7c0172870a9446cfb35c7b3fee6394f3292e3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoFix tests for OS X when the tmpdir is the default /tmp 45/13845/2
Robin Rosenberg [Sun, 16 Jun 2013 10:02:14 +0000 (12:02 +0200)]
Fix tests for OS X when the tmpdir is the default /tmp

/tmp is a symbolic link and some tests break when the path
gets canonicalized by JGit or Jetty. Allow Jetty to serve
symlinks by setting init parameter "aliases" to true [1].

[1] http://wiki.eclipse.org/Jetty/Howto/How_to_serve_symbolically_linked_files

Change-Id: I45359a40435e8a33def6e0bb6784b4d8637793ac
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoFix running maven http tests on OS X 44/13844/2
Robin Rosenberg [Sun, 16 Jun 2013 09:28:36 +0000 (11:28 +0200)]
Fix running maven http tests on OS X

In 36144e12d8 tests were changed to use the system tmp directory as defined
by java.io.tmpdir, which was then overridden in the pom files to usea custom
directory that made som tests work, but not all.

Change-Id: I2fa04878f8830ad9c9b32a6f3fe8d2e2d66fe411

11 years agoDisable warning about assigning to parameter 62/12962/3
Robin Stocker [Sat, 18 May 2013 10:47:27 +0000 (12:47 +0200)]
Disable warning about assigning to parameter

See change I08bed4275af9ec52aa4d7054067ac82f6a3c9781, where fixing such
warning lead to complaints.

If fixing is not wanted, disable it instead.

Change-Id: If31d4028fa1c6377a11e83ed5688b45701cec68b

11 years agoRecognize CRLF when parsing the short message of a commit or tag 67/11567/5
Robin Rosenberg [Sat, 30 Mar 2013 10:03:33 +0000 (11:03 +0100)]
Recognize CRLF when parsing the short message of a commit or tag

Bug: 400707
Change-Id: I9b09bb88528af465018fc0278f5441f7e6b75986

11 years agoAdd missing @since tags 34/13834/1
Matthias Sohn [Fri, 14 Jun 2013 23:10:33 +0000 (01:10 +0200)]
Add missing @since tags

Change-Id: I7f2c155cab4b5be55f7e849ff2595c8c5d804f05
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge "document empty blocks in StashApplyCommandTest"
Matthias Sohn [Fri, 14 Jun 2013 22:57:59 +0000 (18:57 -0400)]
Merge "document empty blocks in StashApplyCommandTest"

11 years agodocument empty blocks in StashApplyCommandTest 44/12544/2
Tomasz Zarna [Mon, 6 May 2013 17:27:42 +0000 (19:27 +0200)]
document empty blocks in StashApplyCommandTest

Change-Id: I5b49bd00b00b86584b912fc5f503abf29db0f56e

11 years agoPrepare 3.1.0-SNAPSHOT builds 99/13799/1
Matthias Sohn [Thu, 13 Jun 2013 13:54:22 +0000 (15:54 +0200)]
Prepare 3.1.0-SNAPSHOT builds

Change-Id: I7490a7c9558423c03e3c167ad55b9a98be9d99d9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge branch 'stable-3.0' 98/13798/1
Matthias Sohn [Thu, 13 Jun 2013 13:51:16 +0000 (15:51 +0200)]
Merge branch 'stable-3.0'

* stable-3.0:
  Prepare post 3.0.0.201306101825-r builds
  JGit v3.0.0.201306101825-r
  Make JGit test work with both hamcrest 1.1 (juno) and 1.3 (kepler)
  Fix version.sh to not overwrite ${project.version}
  Prepare post 3.0.0 RC3 builds
  JGit v3.0.0.201306040240-rc3

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