Commit Graph

3008 Commits

Author SHA1 Message Date
Robin Stocker 31fec678d8 Implement "git branch --contains" in pgm
Bug: 425678
Change-Id: Ib59e05a0bde58562cc61e6e3000df761660b468e
Signed-off-by: Robin Stocker <robin@nibor.org>
2014-03-07 18:24:42 -05:00
Christian Halstrick f6f3fe46fc Fix default profile for target platform used in maven build
Change-Id: I10aef3a3b5c3b3ab9f6ef857a9fcc67ce0b1cec3
2014-03-07 23:05:41 +01:00
Matthias Sohn 0401d3eb47 Fix some wrong @since 3.3 tags which should be @since 3.4
Change-Id: Idafe6e041cc40a00ac52eb4ba88753c49db86988
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-03-07 21:30:58 +01:00
Matthias Sohn effc2f34b8 [findBugs] Declare some private methods of WorkingTreeIterator static
Change-Id: I09cd39c367f408b5a963ff004f235f558990f338
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-03-05 19:01:38 -05:00
Matthias Sohn a482fc7273 Update com.jcraft.jsch to 0.1.50 also in pom dependencies
We updated the target platforms in 3.3 following the version shipped
by the release train but missed to update it in pom dependencies.
This wasn't harmful as there were no API changes between 0.1.46 and
0.1.50.

Change-Id: Ie8ac2ea447fa93d6643b9817f58767ab7f0b1aa4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-03-05 08:46:11 +01:00
Matthias Sohn 47207e98d4 Prepare 3.4.0-SNAPSHOT builds
Change-Id: I907c6f1834c06b8ab4d3e0f76dde475faea7b4a5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-03-05 02:20:38 +01:00
Matthias Sohn 71b90400bb Merge branch 'stable-3.3'
* stable-3.3:
  Update scripts to deploy jgit on Maven central
  Prepare 3.3.1-SNAPSHOT builds
  JGit v3.3.0.201403021825-r
  Fix merge/cherry-picking in CRLF mode
  Expose the received pack size in ReceivePack
  Revert "Add getPackFile to ReceivePack to make PostReceiveHook more usable"
  Avoid an NPE after 7b01a53692
  Add a launcher for Java 7 tests
  Remove obsolete getRepositoryMethod from WorkingTreeIterator
  Fix NPE when WorkingTreeIterator does not have a repository set
  Add getPackFile to ReceivePack to make PostReceiveHook more usable
  Possibility to limit the max pack size on receive-pack
  Package httpclient and httpcore in o.e.j.http.apache.feature

Change-Id: I814a150980854bbaabd767f97b062d247af6cb50
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-03-05 02:02:16 +01:00
Matthias Sohn f59b680c4c Update scripts to deploy jgit on Maven central
Change-Id: I760ad82f2455cfc2cdc76c9331a03b09aebb2349
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-03-05 00:43:21 +01:00
Matthias Sohn c1fee1d16b Prepare 3.3.1-SNAPSHOT builds
Change-Id: If15560f2731e54dbf9db88d8a308b4c25ce27e8e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-03-05 00:34:15 +01:00
Robin Rosenberg b640e3ab31 Merge "Add setContains to ListBranchCommand (branch --contains)" 2014-03-03 18:10:44 -05:00
Robin Rosenberg 1328bfdfeb Merge "DirCache.findEntry(byte[], in) made public" 2014-03-03 17:56:10 -05:00
Robin Rosenberg 96c049b876 Merge "Windows: Test that we can create a symlink before the target is created" 2014-03-03 17:54:05 -05:00
Shawn Pearce fc8ff50e1a Add missing @Deprecated to deprecated fields and methods
Java spec requires the @Deprecated annotation on any deprecated
field or method. Add the missing annotation to fields and methods
already declared deprecated in the javadoc.

Change-Id: Ic0ef24b43cfd99ac947e771ef5a28e493c304274
2014-03-03 10:37:06 -08:00
Matthias Sohn 3d855dbfc6 JGit v3.3.0.201403021825-r
Change-Id: Iaf3da455f7d6f691617299e881154ff8185a9d46
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-03-03 00:26:54 +01:00
Robin Rosenberg fd62a45649 Fix merge/cherry-picking in CRLF mode
This fixes a case where we have CRLF in the repo but
LF in the worktree and are in autocrlf mode.

Change-Id: I0388270c1cf0fd22dfd513bcaa404eb97268d39d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-03-02 20:30:42 +01:00
Robin Rosenberg 31aeaa0931 Merge "Expose the received pack size in ReceivePack" into stable-3.3 2014-03-02 08:17:18 -05:00
Robin Rosenberg 8c82872354 Merge "Revert "Add getPackFile to ReceivePack to make PostReceiveHook more usable"" into stable-3.3 2014-03-02 08:14:14 -05:00
Saša Živkov 835ab30743 Expose the received pack size in ReceivePack
PostReceiveHooks can make use of this information to, for example,
update a cached size of the Git repository.

Change-Id: I2bf1200959a50531e2155a7609c96035ba45b10d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-03-02 01:52:06 +01:00
Saša Živkov ef3d864b1e Revert "Add getPackFile to ReceivePack to make PostReceiveHook more
usable"

This reverts commit 2670fd427c.

By returning an instance of File from the ReceivePack.getPackFile the
abstraction of the persistence implementation was broken.

Change-Id: I28e3ebf3a659a7cbc94be51bba9e1ad338f2b786
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-03-02 01:52:04 +01:00
Robin Rosenberg abff667d40 Avoid an NPE after 7b01a53692
While fixing an NPE, I introduced another one in a deprecated isModified
method. It cannot avoid NPE's entirely, which is the reason the method
is deprecated

Change-Id: I5147c1c94621586dd84bd11e6090a954523b6c1c
2014-03-01 13:02:06 +01:00
Robin Rosenberg 5de70c6fab Add a launcher for Java 7 tests
Just like we have launcher for other packages

Change-Id: I140b88b8fdcab08d6515cd1f0ba9a53a9701f60d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-02-28 10:56:52 +01:00
Robin Rosenberg 9508df3979 Remove obsolete getRepositoryMethod from WorkingTreeIterator
The method was added for symlink support, but isn't needed anymore.
Since it was added for this release it's like it never existed.

Change-Id: I422cd1dcdfa40b25ba3d6e08b112159dae9a4353
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-02-28 10:56:52 +01:00
Robin Rosenberg 7b01a53692 Fix NPE when WorkingTreeIterator does not have a repository set
It's strange that we have that member since it is not so clear
when it it set or not.

Change-Id: I53903a264f46866d249901a3cd9f9295028aa6bd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-02-28 10:44:54 +01:00
Christian Halstrick 83c743e6e2 Merge "Don't raise checkout conflict for file missing in working tree" 2014-02-27 16:17:56 -05:00
Kaloyan Raev 44812c02e8 CLI clone command should support --no-checkout
doCheckout() is called only if --no-checkout option is not set.

Bug: 428917
Change-Id: I350bef446dd7a37613b9506aae99679569bd36e1
Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-02-26 15:52:25 +01:00
Christian Halstrick 73c8e70797 Don't raise checkout conflict for file missing in working tree
During a checkout we want to prevent to overwrite unsaved local file
content. Jgit was therefore checking whether the file to overwrite is
dirty or missing and would raise a conflict if this was the case. That
was wrong. It should only check if the file is dirty. It's ok to
"overwrite" a missing/non-existing file.

Change-Id: I63c3a94f663c87f09170fdf8b1b1bf4ed5246fc5
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
2014-02-26 15:35:05 +01:00
Matthias Sohn df4aca2166 Merge "Add a missing @since tag" 2014-02-26 08:50:42 -05:00
Matthias Sohn a6828b9b73 Merge "Files should be deleted with "retry" option" 2014-02-26 08:49:17 -05:00
Christian Halstrick 8c8bbda3fb Add a missing @since tag
Change-Id: Ie34a4a9c4c47c2f27579094d74a7849fc26a323b
2014-02-26 14:31:29 +01:00
Marc Strapetz 59a2dc801c Files should be deleted with "retry" option
Some of our Windows users have reported sporadic file system access
problems related to ObjectDirectory(Inserter) file deletion code in
combination with antiviral/firewall tools. For one of these users the
problem was fairly reproducible and changing deletion to RETRY solved
his problem.

Change-Id: I1e4001d5557fca693b7bac401268599467cb0c9e
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>‌
2014-02-26 05:53:56 -05:00
Marc Strapetz c5dfc2317c DirCacheEntry: access to raw path
Change-Id: I5d1f6c4b5b3d7a971367cdd0cc9fa4022dff5b85
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>‌
2014-02-26 05:21:35 -05:00
Saša Živkov 2670fd427c Add getPackFile to ReceivePack to make PostReceiveHook more usable
Having access to the pack file that was created by the ReceivePack
may be useful for post receive hooks. For example, a hook may want
to check the size of the received pack and the created index.

Change-Id: I4d51758e4565d32c9f8892242947eb72644b847d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-02-25 18:14:39 +01:00
Saša Živkov 0d05e5d26c Possibility to limit the max pack size on receive-pack
The maxPackSizeLimit, when set, will reject a pack if it exceeds
that limit.

This feature is intended to provide a mechanism to control disk space
quota on Git repositories.

Change-Id: I83d8db670875c395f8171461b402083323e623a5
CQ: 7896
2014-02-25 14:20:31 +01:00
Marc Strapetz ea16c2afff Fix possible NPE in Repository.resolve
Change-Id: I9b19cd90b338a4c3cae5661c658526b7e98c95d1
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>‌
2014-02-24 18:39:38 +01:00
Marc Strapetz 21498aec83 DirCache.findEntry(byte[], in) made public
Change-Id: Ice64e3b0e5d67a39690aa24e41c954b8ce312d49
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>‌
2014-02-24 18:29:27 +01:00
Matthias Sohn 18b030bcb5 Package httpclient and httpcore in o.e.j.http.apache.feature
When adding the new feature o.e.j.http.apache.feature in
I4adfecd56d84ee24a50cadb1700c8be56e4172a3 in order to make the
httpclient based implementation optional I missed to also move the
apache libraries.

Change-Id: I7285458a70aee3dd6faf739b68a0b5783b8da01d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-02-24 01:21:31 +01:00
Matthias Sohn 8e0e78858c Merge branch 'stable-3.3'
* stable-3.3:
  Move Apache httpclient based HTTP support to a separate bundle
  Prepare post 3.3.0RC1 builds
  JGit v3.3.0.201402191814-rc1
  [findBugs] Don't ignore exceptional return value of File.mkdir()
  [findBugs] Don't rely on default encoding
  [findBugs] Don't call toString() on a string

Change-Id: I50f91e1d3c1d29a44502f4bb9f0e6c05e21342b7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-02-21 22:41:13 +01:00
Matthias Sohn 3d3df3942a Move Apache httpclient based HTTP support to a separate bundle
This move avoids that all consumers of org.eclipse.jgit depend on Apache
httpclient. Also add another feature to make this optional for OSGi
consumers as well.

Change-Id: I5ef5e00c53678b9e1d7cfd54bbca3ff6f1c1c967
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-02-20 23:57:21 +01:00
Matthias Sohn 3cebf9c466 Prepare post 3.3.0RC1 builds
Change-Id: I0d808f8733a490b75bbcaacedb4b095e05fab32e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-02-20 01:04:07 +01:00
Matthias Sohn 8bf45c23df JGit v3.3.0.201402191814-rc1
Change-Id: Ida3a0417ae646ce37214153f49a85de2be3dd4fd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-02-20 00:14:45 +01:00
Matthias Sohn 514719aa67 [findBugs] Don't ignore exceptional return value of File.mkdir()
Change-Id: Ic4c61472412aa158a355bb444805cde8c5d2833a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-02-18 22:08:09 +01:00
Matthias Sohn db1877628d [findBugs] Don't rely on default encoding
Change-Id: I9be2ffe95e8d716326ba63b67672741ac316f9a5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-02-18 22:08:08 +01:00
Matthias Sohn 8fe327a8a1 [findBugs] Don't call toString() on a string
Change-Id: I0b91ffd473e2f14623ddf409e4f0f342c8941e42
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-02-18 22:08:08 +01:00
Shawn Pearce f2f24a304d Fix diff header on renamed or copied files
When git-core renames or copies a file and the mode differs the
header shows the mode change first, then the rename or copy data:

  diff --git a/COPYING b/LICENSE
  old mode 100644
  new mode 100755
  similarity index 92%
  rename from COPYING
  rename to LICENSE
  index d645695..54863be
  --- a/COPYING
  +++ b/LICENSE
  @@ -56,20 +56,6 @@

JGit relies on this ordering inside of FileHeader. Parsing "new file
mode NNN" after "copy from/to" or "rename from/to" resets the change
type to be ADD, losing the COPIED or RENAMED status and old path.

This fixes a 4 year old bug in Gerrit Code Review that prevents
opening a file for review if the file was copied from another file,
modified in this change, and the mode was updated (e.g. execute
bit was added).

Change-Id: If4c9ecd61ef0ca8e3e1ea857301f7b5c948efb96
[ms: added test case]
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-02-18 22:08:07 +01:00
Christian Halstrick 2290516ddb Add an implementation for HttpConnection using Apache HttpClient
This change implements the http connection abstraction with the help of
org.apache.http.client.HttpClient. The default implementation used by
JGit is still the JDK HttpURLConnection. But now JGit users have the
possibility to switch completely to org.apache.httpclient. The reason
for this is that in certain (e.g. cloud) environments you are forced to
use the org.apache classes.

Change-Id: I0b357f23243ed13a014c79ba179fa327dfe318b2
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-02-18 21:04:17 +01:00
Christian Halstrick 38c4f35d8b Introduce an abstraction for HTTP connections
Previously all HTTP communication was done with the help of
java.net.HttpUrlConnection. In order to make JGit usable in environments
where the direct usage of such connections is not allowed but where the
environment provides other means to get network connections an
abstraction for connections is introduced. The idea is that new
implementations of this interface will be introduced which will not use
java.net.HttpUrlConnection but use e.g.
org.apache.client.http.HttpClient to provide network connections.

One example: certain cloud infrastructures don't allow that components
in the cloud communicate directly with HttpUrlConnection. Instead they
provide services where a component can ask for a connection (given a
symbolic name for the destination) and where the infrastructure returns
a preconfigured org.apache.http.client.HttpClient. In order to allow
JGit to be running in such environments we need the abstraction
introduced in this commit.

Change-Id: I3b06629f90a118bd284e55bb3f6465fe7d10463d
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-02-18 21:04:10 +01:00
Shawn Pearce f08fde3eeb Remove dead isBinary method from DiffFormatter
This method always returns false and is private so it cannot be
overridden at runtime by a subclass. Drop the method and the branch
that can never be taken.

Change-Id: I4d3edbf469c6739dca191e62ea580bdb534b67a4
2014-02-17 22:15:55 +01:00
Shawn Pearce 3fc5791778 Add missing static qualifier in DiffFormatter
These methods do not touch instance members and can avoid the
implicit "this" argument.

Change-Id: I01c30bb22266eed1c9db18bdf9f90c1c1590e3ec
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-02-17 22:15:51 +01:00
Matthias Sohn 1eae309723 Allow programmatic remote configuration for PullCommand
Also imply remoteBranchName to match current branch name if it wasn't
configured in branch configuration.

Bug: 424812
Change-Id: Id852cedaefb2a537b6aa3c330b9861efad052f11
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-02-14 16:10:59 +01:00
James Yonan 7bb7299e8a Fix a NullPointerException if properties file doesn't exist
For example with following URL,

  amazon-s3://.jgit@mybucket/foo.git

if ~/.jgit is missing, jgit command will throw a NullPointerException.

With this patch, a reasonable error message will be emitted:

  fatal: Cannot read file /Users/jamesyonan/.jgit

Change-Id: I1d366f2d55e170d2972715c657c8e2d10c8d87d2
Signed-off-by: James Yonan <james@openvpn.net>
2014-02-13 18:58:03 -05:00