summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Prepare 3.3.1-SNAPSHOT buildsMatthias Sohn2014-03-0555-258/+258
| | | | Change-Id: If15560f2731e54dbf9db88d8a308b4c25ce27e8e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v3.3.0.201403021825-rv3.3.0.201403021825-rMatthias Sohn2014-03-0355-55/+55
| | | | | Change-Id: Iaf3da455f7d6f691617299e881154ff8185a9d46 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix merge/cherry-picking in CRLF modeRobin Rosenberg2014-03-022-8/+47
| | | | | | | 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>
* Merge "Expose the received pack size in ReceivePack" into stable-3.3Robin Rosenberg2014-03-026-0/+216
|\
| * Expose the received pack size in ReceivePackSaša Živkov2014-03-026-0/+216
| | | | | | | | | | | | | | 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>
* | Merge "Revert "Add getPackFile to ReceivePack to make PostReceiveHook more ↵Robin Rosenberg2014-03-024-39/+2
|\| | | | | | | usable"" into stable-3.3
| * Revert "Add getPackFile to ReceivePack to make PostReceiveHook moreSaša Živkov2014-03-024-39/+2
| | | | | | | | | | | | | | | | | | | | | | usable" This reverts commit 2670fd427cd4aad49ccdb6dde66271fdffff86f8. 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>
* | Avoid an NPE after 7b01a5369210Robin Rosenberg2014-03-011-1/+2
|/ | | | | | | | 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
* Add a launcher for Java 7 testsRobin Rosenberg2014-02-281-0/+20
| | | | | | Just like we have launcher for other packages Change-Id: I140b88b8fdcab08d6515cd1f0ba9a53a9701f60d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Remove obsolete getRepositoryMethod from WorkingTreeIteratorRobin Rosenberg2014-02-281-9/+0
| | | | | | | 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>
* Fix NPE when WorkingTreeIterator does not have a repository setRobin Rosenberg2014-02-282-6/+9
| | | | | | | 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>
* Add getPackFile to ReceivePack to make PostReceiveHook more usableSaša Živkov2014-02-254-2/+39
| | | | | | | | | 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>
* Possibility to limit the max pack size on receive-packSaša Živkov2014-02-255-0/+259
| | | | | | | | | | | 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
* Package httpclient and httpcore in o.e.j.http.apache.featureMatthias Sohn2014-02-242-14/+14
| | | | | | | | | 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>
* Move Apache httpclient based HTTP support to a separate bundleMatthias Sohn2014-02-2041-23/+1392
| | | | | | | | 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>
* Prepare post 3.3.0RC1 buildsMatthias Sohn2014-02-2051-51/+51
| | | | | Change-Id: I0d808f8733a490b75bbcaacedb4b095e05fab32e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v3.3.0.201402191814-rc1v3.3.0.201402191814-rc1Matthias Sohn2014-02-2051-51/+51
| | | | | Change-Id: Ida3a0417ae646ce37214153f49a85de2be3dd4fd Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* [findBugs] Don't ignore exceptional return value of File.mkdir()Matthias Sohn2014-02-181-1/+2
| | | | Change-Id: Ic4c61472412aa158a355bb444805cde8c5d2833a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* [findBugs] Don't rely on default encodingMatthias Sohn2014-02-181-1/+1
| | | | Change-Id: I9be2ffe95e8d716326ba63b67672741ac316f9a5 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* [findBugs] Don't call toString() on a stringMatthias Sohn2014-02-181-1/+1
| | | | Change-Id: I0b91ffd473e2f14623ddf409e4f0f342c8941e42 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix diff header on renamed or copied filesShawn Pearce2014-02-182-16/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add an implementation for HttpConnection using Apache HttpClientChristian Halstrick2014-02-1818-1/+677
| | | | | | | | | | | | | 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>
* Introduce an abstraction for HTTP connectionsChristian Halstrick2014-02-1812-55/+741
| | | | | | | | | | | | | | | | | | | | | | 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>
* Remove dead isBinary method from DiffFormatterShawn Pearce2014-02-171-7/+0
| | | | | | | | 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
* Add missing static qualifier in DiffFormatterShawn Pearce2014-02-171-2/+2
| | | | | | | 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>
* Allow programmatic remote configuration for PullCommandMatthias Sohn2014-02-142-16/+133
| | | | | | | | 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>
* Fix a NullPointerException if properties file doesn't existJames Yonan2014-02-131-2/+8
| | | | | | | | | | | | | | | 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>
* Use branch.<x>.mergeoptions and merge.ff as defaults for mergingKonrad Kügler2014-02-143-6/+259
| | | | | | | | | Read options that control squashing, whether or not to commit the merge and regarding fast forwarding from the configuration and use them if no explicit values for these options have been provided to MergeCommand. Change-Id: Ifdaed4b5e4adc142657c03c8e78b709a99eeddbd Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Non-Fast-Forward Ref-Updates: Omit isMergedInto() callsRoberto Tyley2014-02-133-3/+24
| | | | | | | | | | | | When the caller specifies to JGit in advance that a ref-update is a non-fast-forward update, and that those are permitted, we should never need to call the potentially expensive isMergedInto() check. Re-checking that the older commit is /not/ reachable from the newer is superfluous. http://dev.eclipse.org/mhonarc/lists/jgit-dev/msg02258.html Change-Id: I4bbf593de4dcea6b6f082881c1a33cb3a6a7fb89 Signed-off-by: Roberto Tyley <roberto.tyley@gmail.com>
* Initialise ReceiveCommand status to NOT_ATTEMPTED for all constructorsRoberto Tyley2014-02-132-5/+2
| | | | | | | | | | | | | Formerly the 4-arg constructor did not do this, which was unfortunate as that constructor's the only way for an external user of JGit to set the /type/ of the ref-update - which you might want to do to indicate that the update is expected to be a UPDATE_NONFASTFORWARD, and thus does not require expensive isMergedInto() calculations: http://dev.eclipse.org/mhonarc/lists/jgit-dev/msg02258.html Change-Id: I84c5e4927131e105bed93e31a62da6367c78de32 Signed-off-by: Roberto Tyley <roberto.tyley@gmail.com>
* Use fetch.prune and remote.<name>.prune to set prune mode when fetchingKonrad Kügler2014-02-132-4/+30
| | | | | | | | | | | When no explicit value is set via FetchCommand.setRemoveDeletedRefs() checks if pruning is enabled in the configuration. The following commit introduced the prune config to C Git: https://github.com/git/git/commit/737c5a9cde708d6995c765b7c2e95033edd0a896 Change-Id: Ida79d335218e1c9f5c6e2ce03386ac8a1c0b212e Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add some tests cases on files modes for symbolic linksAxel Richard2014-02-122-0/+264
| | | | | | | | | Test that the file mode of a file is the one expected before and after a checkout. Tests between symlink and file, symlink and folder, symlink and missing. Change-Id: If65a85a5667e25103eb9fd328a8723e29de04a1f Signed-off-by: Axel Richard <axel.richard@obeo.fr> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add some test cases for symbolic links with Java7Robin Rosenberg2014-02-123-0/+273
| | | | Change-Id: Ia4c9c7902316bc0a90fb89d8dea9902835c06dfa
* Normalize paths on OS XRobin Rosenberg2014-02-125-7/+66
| | | | | | | Java normalizes paths to NFC, but other source may not, e.g Eclipse. Bug: 413390 Change-Id: I08649ac58c9b3cb8bf12794703e4137b1b4e94d5 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Recognize symlinks in the FileTreeIteratorRobin Rosenberg2014-02-121-1/+3
| | | | | | We did this for the Eclipse Platform in the ContainerTreeIterator. Change-Id: I80d8157cc0dd99d57e2ed5d7cd8b13525a0c62b1
* Add special case to WorkingTreeIterator for matching unnormalized symlinksRobin Rosenberg2014-02-121-3/+33
| | | | | | | | | If there is an unnormalized symbolic link in the index, lie that it matches a normalized link in the working tree. This does not make the case completely invisible everywhere though, but it helps to some degree. Change-Id: I599fb71648c41fa2310049d0e0040b3c9f09386b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* FileUtils.delete does not recurse via symlinksRobin Rosenberg2014-02-121-0/+86
| | | | Change-Id: I134cfbda47f4d252fec1a16034e2e78b73cd5081
* Use fileAttributes to get more attributes in one goRobin Rosenberg2014-02-127-49/+267
| | | | | | | | | On Windows the length reported by FileAttributes is the size of the target file (a bug, I guess) rather than the link, so we read the linke and look at the length of the link instead. Bug: 353771 Change-Id: I834b06d0447f84379612b8c9190fa77093617595 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix RevWalkUtils.findBranchesReachableFrom not finding some branchesRobin Stocker2014-02-112-27/+132
| | | | | | | | | | | | | | | | | | | | | | | The "cut off" optimization causes it to not include branches that contain the specified commit but happen to share commits with a branch that does not contain the commit. An example: -B foo \ -A---C master findBranchesReachableFrom for commit A with both branches as input may not return master (depending on the order of the input). The reason is that A is not contained in foo, and therefore the old code would put B in the cutOff set. When then walking the master commits and B is checked, it is found in the cutOff set and the walk is aborted, causing master not to be returned even though it should. Bug: 425674 Change-Id: I2c0c406ce5fcc9a03538b483473af930d4895d30 Signed-off-by: Robin Stocker <robin@nibor.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Length of symbolic link is the number of bytes, not charactersRobin Rosenberg2014-02-102-7/+8
| | | | Change-Id: I6b615f0d5da4339f1f23a29bcaeb80f0346f5764
* Add delete support to FSRobin Rosenberg2014-02-105-0/+35
| | | | Change-Id: Ib6f6fd5ef4a0c9b2062445ac4a0c9d1131e401bf
* Dynamically detect if Windows supports symbolic linksRobin Rosenberg2014-02-101-1/+25
| | | | | | To get symlink support you typically need to run as administrator. Change-Id: I394ea75bc2f250c62f860e537a0af9e6380b3b38 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add symlink support to JGitRobin Rosenberg2014-02-1014-64/+183
| | | | | | | | | | | | | | | | | | | | The change includes comparing symbolic links between disk and index, adding symbolic links to the index, creating/modifying links on checkout. The behavior is controlled by the core.symlinks setting, just as C Git does. When a new repository is created core.symlinks will be set depending on the capabilities of the operating system and Java runtime. If core.symlinks is set to true, the assumption is that symlinks are supported, which may result in runtime errors if this turns out not to be the case. Measuring the cost of jgit status on a repository with ~70000 files, of which ~30000 are tracked reveals a penalty of about 10% for using the Java7 (really NIO2) support module. Bug: 354367 Change-Id: I12f0fdd9d26212324a586896ef7eb1f6ff89c39c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Use the new FS.exists method in commonly occuring placesRobin Rosenberg2014-02-105-6/+8
| | | | | | Allegedly this should improve performance, but I could not see it. Change-Id: Id2057cb2cfcb46e94ff954483ce23f9c4a7edc5e
* Fix deprecated WTI#isModifiedRobin Rosenberg2014-02-101-1/+1
| | | | | | | We should really pass the forceContentCheck parameter to the real method. Change-Id: I9ea439cf6340a18d0e931edde3b9e3486cafde93 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Failing to delete a directory with untracked content is actually okRobin Rosenberg2014-02-102-7/+7
| | | | | | | We had a test, but it was wrong. Bug: 424630 Change-Id: I926e0954c8623a323a50fe8be3ebe5e0ac6944c8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Ban dangerous ref names in WindowsRobin Rosenberg2014-02-053-17/+83
| | | | | | | Bug: 423551 Change-Id: I3e71ef1b4a8181f46d2902c9169859f150cd6ad0 Also-By: Robin Stocker <robin@nibor.org> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge "Reset internal state canonical length in WorkingTreeIterator when moving"Matthias Sohn2014-02-042-2/+15
|\
| * Reset internal state canonical length in WorkingTreeIterator when movingRobin Rosenberg2014-02-032-2/+15
| | | | | | | | | | Bug: 426514 Change-Id: Ifb75a4fa12291aeeece3dda129a65f0c1fd5e0eb Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge "Fix MissingObjectException race in ObjectDirectory"Shawn Pearce2014-02-035-394/+290
|\ \ | |/ |/|