Commit Graph

2942 Commits

Author SHA1 Message Date
Matthias Sohn 35331a916a Also use MockSystemReader in GitDateParserBadlyFormattedTest
All tests should use MockSystemReader to isolate them from the
underlying platform specifics.

GitDateParserBadlyFormattedTest wasn't using MockSystemReader which
induced Bug 420772 as a side effect since GitDateParser caches
SimpleDateFormat instances without regarding their locale. This will be
fixed in another change

Bug: 420772
Change-Id: I798e55d05730a71bb0326f80aea5488541d6c1f2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-11-05 09:29:13 +01:00
Christian Halstrick b686fa45b6 Merge "testMaliciousPathEmpty fails on Windows" 2013-11-04 07:39:43 -05:00
Dave Borowitz 17dc02a579 Merge "Revert "Close unfinished archive entries on error"" 2013-11-01 23:12:29 -04:00
Shawn Pearce 75cfa03e16 Use absolute paths for file:// URIs in tests
When run under Buck the repository paths may be relative.  Request
an absolute path to construct the URI, as relative paths are not
supported in file:// style URIs.

Change-Id: I85470d1db2f4e80cba30f1559c0d99bdfa8ac410
2013-11-01 19:57:47 -07:00
Shawn Pearce 69c1244989 Use getPath() in FileResolverTest
Necessary to get tests to pass when running under Buck.
Has no impact on Maven based invocation of tests.

Change-Id: I437114863df0bac346c94ef13796def47333d916
2013-11-01 19:57:47 -07:00
Shawn Pearce b0dbb78e7d Extract protocol constants to a common class
This avoids the server from referencing the client code directly.

Change-Id: Ie6ade781b5a689646ad8b0b2988ef2b544412195
2013-11-01 19:57:47 -07:00
Shawn Pearce 1c4216e4bc Move repeat() to utility class for tests
Avoid depending on AutoCRLFOutputStreamTest from within another
test such as AutoCRLFInputStreamTest. Breaking the dependency up
allows the test classes to be built and executed in parallel.

Change-Id: Ic9ab2b6ec74ac87ff4adda8a802ae343dd2a6235
2013-11-01 19:57:47 -07:00
Shawn Pearce cc3ec72734 Remove hardcoded target/trash from test cases
Buck does not create a target directory for the build output, this
is Maven specific and the project unit tests should not rely on it.

Instead follow the pattern used by org.eclipse.jgit.test which is to
create a temporary directory in the system temporary folder, and
configure the Maven surefire plugin to use the target directory.

Change-Id: Iebe5093332343a90f51080614e083aac0d29c26d
2013-11-01 19:57:47 -07:00
Shawn Pearce e59b324095 Remove dependency on StatusCommandTest
Move the set constructor function to a Sets utility class,
allowing the tests to compile in parallel.

Change-Id: Id6fac2533fab8d423f949c892f199af2491a450b
2013-11-01 19:57:47 -07:00
Shawn Pearce 5f9656c404 Remove dependency on DiffFormatterReflowTest
Reference the resource from the root of the CLASSPATH, allowing the
test classes to be compiled in parallel with no dependencies.

Change-Id: Ia6becf30ccfe93b8585b82293d9a4863b0cf837e
2013-11-01 19:57:47 -07:00
Shawn Pearce 3bc289bcfe Remove unnecessary import of BaseConnection in MessageWriter
Change-Id: I2af8b0ac0f9fbf2814eca23990ae527baf040539
2013-11-01 19:57:47 -07:00
Tobias Pfeifer da9db6b20c Enable to prepare interactive rebase and then start it explicitly
Add Operation.PROCESS_STEPS to RebaseCommand to enable starting
interactive rebase explicitly after rebase steps have been configured.

Change-Id: I2d6f0de82010ea6523fbce6fb4501e847bdcdddc
Signed-off-by: Tobias Pfeifer <to.pfeifer@web.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-11-01 23:43:59 +01:00
Robin Rosenberg 98bc384d2b testMaliciousPathEmpty fails on Windows
Checking of spaces at the end of the file name caused the
test to fail for Windows only.

Bug: 396662
Change-Id: I47bcccb0fa32ce606276c3f30d454851d115ca11
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2013-11-01 16:43:46 +01:00
Tobias Pfeifer baab84836a Parse commitId and shortMessage of a commented out line in rebase todo
A rebase todo file consists of regular non-comment action lines and
comment lines. In case that a regular action line has been commented out
(i.e. prefixed with a hash '#'), the RebaseTodoLine that is representing
this line should hold the values for commitId and shortMessage even
though it's a comment line. This allows to switch between comment and
non-comment easily even after the file has been persisted and reread.

Change-Id: I56ec2ba08eaf3772e2d74d937dd496209a744d4b
Signed-off-by: Tobias Pfeifer <to.pfeifer@web.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-31 14:25:29 +01:00
Christian Halstrick c3873b584f Enhance reading of git-rebase-todo formatted files
Reading and writing files formatted like the git-rebase-todo files was
hidden in the RebaseCommand. Certain constructs (like leading tabs and
spaces) have not been handled as in native git. Also the upcoming
rebase interactive feature in EGit needs reading/writing these files
independently from a RebaseCommand.

Therefore reading and writing those files has been moved to the
Repository class. RebaseCommand gets smaller because of that and doesn't
have to deal with reading/writing files.

Additional tests for empty todo-list files, or files containing comments
have been added.

Change-Id: I323f3619952fecdf28ddf50139a88e0bea34f5ba
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Also-by: Tobias Pfeifer <to.pfeifer@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-31 14:22:20 +01:00
Matthias Sohn e649287502 Enhance RepositoryTestCase.commitFile() to work on empty repository
Change-Id: Ic64497f0eedf8996ba593ca52dc9a040732a5b24
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-31 08:28:46 -04:00
Matthias Sohn 7904060a5a Merge "Add missing resources from source.. in build.properties" 2013-10-30 18:21:28 -04:00
Matthias Sohn 6900aa1430 Remove protobuf from target platform
Change-Id: Ic160a021c376f02c8a839a766c69a0558f2a361e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-30 13:04:40 -04:00
Tomasz Zarna 52ce448662 Add missing resources from source.. in build.properties
Change-Id: Ief9b84c07494bdb01ce16b4ae3353c5364cc6625
Signed-off-by: Tomasz Zarna <tomasz.zarna@tasktop.com>
2013-10-30 17:42:38 +01:00
Michael Nelson 9e9f00df9e Support extension of TransportHttp
This allows subclasses to configure the HTTP connection (for example,
to add headers to the request).

Bug: 400724
Change-Id: I6f9d699e158a7b9d813c8fa8d273992a28994e41
Signed-off-by: Michael Nelson <michael.nelson@tasktop.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2013-10-26 18:20:27 -04:00
Kaloyan Raev 40e8ba4186 CLI fetch command should support --tags
Bug: 419638
Change-Id: I1dc99fd38e678e091a1d141d741328f0dec1756a
Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2013-10-26 17:25:23 -04:00
Rüdiger Herrmann 9b1c965446 Add missing JUnit dependency in MANFEST.MF
Bug: 419998
Change-Id: Ie49ad97cb86d51274251296cee559141bfdb9fc9
Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-25 00:21:31 +02:00
Matthias Sohn 72c7618571 Add / fix @since tags
Change-Id: I1e5bea968b3c79df4f600b75fde5b547ebadde36
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-24 08:32:47 +02:00
Robin Stocker 09711a4bb9 Make sure SystemReader is reset after test is run
Otherwise the MockSystemReader from the test setup is active for other
tests.

Change-Id: I7caf693bd692d06936e29efd4dc4aabb48c1c39b
Signed-off-by: Robin Stocker <robin@nibor.org>
2013-10-22 00:37:56 +02:00
Robin Rosenberg 057321731e Merge "Add describe command to JGit command line interface" 2013-10-20 12:31:25 -04:00
Matthias Sohn a0cef63f6d Merge "Fix failed tests when the tmp directory is a symlink" 2013-10-19 18:14:46 -04:00
Robin Rosenberg 068e2df1ce Fix failed tests when the tmp directory is a symlink
On Mac OS X /tmp is by default a symbolic link.

Change-Id: I0913ee5ee8db5c5918a9e41abbbfe125b6c70783
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-20 00:13:58 +02:00
Robin Rosenberg c01a66deba Merge changes I5a5a2387,I04805ce2
* changes:
  Describe HEAD if no explicit target was set
  Allow to set target of DescribeCommand
2013-10-19 09:55:58 -04:00
Matthias Sohn 8de3512890 Scripts to publish jgit artifacts on Maven central
- you need an account on oss.sonatype.org and permissions for group id
  org.eclipse.jgit, see [1]
- install ruby [2] if necessary
- run download.rb to download the Maven artifacts from repo.eclipse.org
- then run deploy.rb to stage the artifacts on oss.sonatype.org
- follow [3] to close the staging repository which triggers some sanity
checks on Nexus
- ask community to test artifacts from staging repository
- if tests are ok release the staging repository as described in [4]

[1] https://issues.sonatype.org/browse/OSSRH-2758
[2] https://www.ruby-lang.org/en/downloads/
[3]
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-7b.StageExistingArtifacts
[4]
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-8a.ReleaseIt

Change-Id: I830f2392b9234e585b01dbb4a5a369edd88796a2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-17 23:15:46 +02:00
Kaloyan Raev 46c839abd5 CLI version command falls back to Bundle-Version
If the version command cannot read the Implementation-Version of the
containing JAR fall back to read the Bundle-Version header in
MANIFEST.MF. This makes the command working also from the
org.eclipse.jgit.pgm bundle and during development in a host IDE.

Bug: 419087
Change-Id: I4269d1cbd9bf9fd8be6fb4463aecc1c434aa387b
Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-12 22:45:27 +02:00
Matthias Sohn 401212de7a Add describe command to JGit command line interface
Change-Id: I1560fd2be417361b3d2df15a27618053031bd873
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-11 00:52:11 +02:00
Matthias Sohn b15c617d0f Describe HEAD if no explicit target was set
Change-Id: I5a5a238709df813ec07278bb3b4f9ea5c85c0883
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-11 00:12:44 +02:00
Matthias Sohn 3c2c8b47ff Allow to set target of DescribeCommand
Change-Id: I04805ce20cc203f5e491406c39b71e7017553b37
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-11 00:11:00 +02:00
Matthias Sohn f3d323e9fe List all supported formats in archive command's help
Change-Id: I4bd271cb348914642069239853488f4960444746
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-10 23:36:07 +02:00
Robin Stocker ec56d0d82a Merge "Add support for --version in JGit CLI" 2013-10-10 07:53:57 -04:00
Kaloyan Raev 4d2378f41b Add resources/ as source folder in build.properties
This allows correct export of org.eclipse.jgit.pgm via the PDE Export
wizard.

Bug: 419089
Change-Id: I98765208edd7df59e262001dd01ed2b43e4475a9
Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
2013-10-10 00:49:58 +03:00
Kaloyan Raev 2c969ea00b Add support for --version in JGit CLI
Bug: 419000
Change-Id: I43f5267182ea69d1f9abbff33136e0491c629071
Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
2013-10-09 20:37:03 +03:00
Colby Ranger 06ddee1c3f Fix ServiceMayNotContinueException constructors for Java 1.5
IOException did not add a (String, Throwable) constructor until 1.5.
Instead use the String super constructor and initCause to initialize
the exception.

Fixes bug 418889

Change-Id: Ide735ecfc7d04884981b79b57a4275863ce17006
2013-10-08 10:16:45 -07:00
Colby Ranger a27529c822 Add constructors that take Throwable to ServiceMayNotContinueException.
ServiceMayNotContinueException usually wraps an underlying exception.
Add convenience constructors that take Throwable. In the case a
string is not provided, the message defaults to "internal server error",
since it may be reported to the client.

Change-Id: I15dc20306826c352f69e88afb7ed6927c12b6c1f
2013-10-07 17:31:06 -04:00
Colby Ranger 5218f7b33a Propagate IOException where possible when getting refs.
Currently, Repository.getAllRefs() and Repository.getTags() silently
ignores an IOException and instead returns an empty map. Repository
is a public API and as such cannot be changed until the next major
revision change. Where possible, update the internal jgit APIs to
use the RefDatabase directly, since it propagates the error.

Change-Id: I4e4537d8bd0fa772f388262684c5c4ca1929dc4c
2013-10-07 11:32:54 -07:00
Matthias Sohn 7995d87713 Prepare 3.2.0-SNAPSHOT builds
Change-Id: Iac6cf7a5bb6146ee3fe38abe8020fc3fc4217584
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-03 18:21:31 +02:00
Matthias Sohn fdc80f7cad Merge branch 'stable-3.1'
* stable-3.1:
  Prepare post 3.1.0 builds
  JGit v3.1.0.201310021548-r
  Fix order of commits in rebase todo file header
  Prepare post 3.1.0 RC1 builds
  JGit v3.1.0.201309270735-rc1
  Attempt to fix graph layout when new heads are introduced
  Prepare re-signing pgm's ueberjar to avoid SecurityException
  Use full branch name when getting ref in BranchTrackingStatus

Change-Id: Ida30175d0c058048cbe4b563aae7f85cd008db29
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-03 17:39:33 +02:00
Matthias Sohn da6e87bc37 Prepare post 3.1.0 builds
Change-Id: I306a3d40c6ddb88a16d17f09a60e3d19b0716962
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-03 17:29:00 +02:00
Matthias Sohn 16ca725b35 JGit v3.1.0.201310021548-r
Change-Id: I2170b13047d5eab7565f47f9feb1680e03b1ba09
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-02 22:09:19 +02:00
Matthias Sohn 0be59ab033 Merge "Added the git-describe implementation" 2013-10-02 15:45:22 -04:00
Stefan Lay c6aba99668 Fix order of commits in rebase todo file header
Change-Id: I0e41d89bbd4fc01ad3b3d05a45ee60af853bfae7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-09-29 22:17:44 +02:00
Matthias Sohn 5a2a2222ef Prepare post 3.1.0 RC1 builds
Change-Id: I060f2082ccd0c91905b6b29a49cc633a0b51a1f2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-09-27 15:54:40 +02:00
Matthias Sohn 6f0681eb9f JGit v3.1.0.201309270735-rc1
Change-Id: I48202dd461110da25f9bc159c938311fff0669e0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-09-27 13:34:51 +02:00
Kohsuke Kawaguchi f045a68a78 Added the git-describe implementation
CQ: 7609
Bug: 339246
Change-Id: I689bc0578ce3a430b9800ad84122e221c69829f4
Signed-off-by: Kohsuke Kawaguchi <kk@kohsuke.org>
Also-By: Robin Stocker<robin@nibor.org>
Also-By: Matthias Sohn <matthias.sohn@sap.com>
Also-By: Christian Halstrick <christian.halstrick@sap.com>
2013-09-27 12:37:36 +02:00
Robin Rosenberg a065a06c2a Attempt to fix graph layout when new heads are introduced
Sometime the new commit is no allocated onto a new lane leading to
the commit being drawn on the wrong branch and something that looks
like a merge.

The drawback is that this also changes existing valid graphs.

Bug: 368927
Change-Id: Ic8a8247c8a53be802c1be83850ed766b902ca646
2013-09-26 14:06:39 +02:00