summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
Commit message (Collapse)AuthorAgeFilesLines
* Bazel: Add missing test dependency on ObjectIdMatcherDavid Pursehouse2018-11-051-0/+1
| | | | | | | | | Test plan: bazel build //... Change-Id: I28a8d3cfa54b46b95043ddd7bfdd1412c6b54865 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Merge changes from topic 'client-caps-v0-test'Jonathan Nieder2018-11-023-23/+313
|\ | | | | | | | | | | * changes: Add test for protocol v0 parser ObjectIdMatcher: Custom matcher for sets of ObjectIds
| * Add test for protocol v0 parserIvan Frade2018-10-241-0/+199
| | | | | | | | | | | | | | ProtocolV2Parser has unit tests but protocol v0/v1 is not covered. Change-Id: I96022e8f8eb60d4da748d1042474fd1efd67e882 Signed-off-by: Ivan Frade <ifrade@google.com>
| * ObjectIdMatcher: Custom matcher for sets of ObjectIdsIvan Frade2018-10-242-23/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Parsed requests represent object ids (SHA1) in ObjectId instances but tests use strings for those ids because they are easier to define. Create a custom matcher that hides the conversion from string to ObjectId. Note that this reverses the existing code conversion (it was transforming ObjectIds into string). This produces more readable code, consistent with the other hamcrest assertions. Change-Id: I47ba1d25557d791fe74fb93c740ff7de9923cc00 Signed-off-by: Ivan Frade <ifrade@google.com>
* | Fix test setup for Eclipse Photon and greaterThomas Wolf2018-11-023-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When a source folder is marked as a test folder, JDT requires that it has an output folder different from the one used for regular sources. Therefore give the test folders in org.eclipse.jgit.test a separate output folder "bin-tst". Moreover JDT reports errors if non-test classes have dependencies on test classes. Therefore remove the "test" annotation from org.eclipse.jgit.junit. Change-Id: Ib527439ff5b7d7b570b8a60819ecaa70f59c63a3 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | RepoCommand: Preserve executable bit in <copyfile>Ivan Frade2018-10-311-0/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | The copyfile entry in the manifest file copies the contents of the file but doesn't keep the executable flag. This is inconsistent with repo tool behaviour, plus is natural to expect that the copy of a executable file is executable. Transfer the executable bit when copying the file, aligning the RepoCommand with repo tool and user expectations. Change-Id: I01b24f482d5939e01d496f032388b3a5c02a912a Signed-off-by: Ivan Frade <ifrade@google.com>
* | RepoCommand.RemoteReader: Add method to read contents and mode of fileIvan Frade2018-10-311-12/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RepoCommand.RemoteReader interface doesn't offer access to the mode of a file. Caller can only default to mark the copied objects as regular files, losing e.g. the executable bit (if set). Add a new method readFileWithMode that returns the contents and mode of the remote file. It supersedes the readFile method, that is marked as deprecated. Now callers can set correctly the file mode of the copied file. Change-Id: I8fce01e4bc5707434c0cbc4aebbae1b6b64756f0 Signed-off-by: Ivan Frade <ifrade@google.com>
* | RepoCommandTest: Extract method to assert file contentsIvan Frade2018-10-301-42/+17
| | | | | | | | | | | | | | | | | | | | | | Many tests verify the contents of files in a try-with-resources incantation that clutters the code. Extract that verification to an "assertContents" method, that is easier to read. Change-Id: If430eac6f5b9ae352e42b2d43867ceb6cd618fbb Signed-off-by: Ivan Frade <ifrade@google.com>
* | gitignore/gitattributes: fix matching of \rMarc Strapetz2018-10-272-0/+17
| | | | | | | | | | | | | | Patterns should treat \r in file names as normal characters Change-Id: Ica3e0fa4a58acf5326db46bb28571fe5f20f6cd2 Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
* | UploadPack: Implement deepen-not for protocol v2Jonathan Tan2018-10-231-0/+106
| | | | | | | | | | | | | | | | | | | | | | | | This allows clients to use the --shallow-exclude parameter (producing a "deepen-not <ref>" line when communicating with the server) in their fetch commands when fetching against a JGit server using protocol v2. Note that the implementation in this commit is somewhat inefficient, as described in the TODO comment in DepthGenerator. Change-Id: I9fad3ed9276b624d8f668356ffd99a067dc67ef7 Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
* | Throw error when deepen-since excludes all commitsJonathan Tan2018-10-231-0/+20
|/ | | | | | | | | | | | | | | | | In C Git, when a client fetches with "git fetch --shallow-since=<date> origin <ref>", and all commits reachable from <ref> are older than <date>, the server dies with a message "no commits selected for shallow requests". That is, (1) the --shallow-since filter applies to the commit pointed to by the ref itself, and (2) there is a check that at least one commit is not filtered out. (The pack-protocol.txt documentation does not describe this, but the C implementation does this.) The implementation in commit 1bb430dc21 ("UploadPack: support deepen-since in protocol v2", 2018-09-27) does neither (1) nor (2), so do both of these. Change-Id: I9946327a71627626ecce34ca2d017d2add8867fc Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
* Merge changes from topic 'moving-to-request-2'Jonathan Nieder2018-10-222-15/+70
|\ | | | | | | | | | | * changes: UploadPack v0: Extract "agent" client capability at parse time UploadPack: Return correct peer user agent on v2 requests
| * UploadPack v0: Extract "agent" client capability at parse timeIvan Frade2018-10-221-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | The request receives a list of capabilities and takes out the "agent" to offer it on its own setter (getAgent). Do this at parse time: when reading the line if the capability is "agent" set it directly in the builder. This makes the treatment of "agent" consistent in v0/v1 and v2. Change-Id: Ie4f9f2cad8639adeeaef4921df49a30a8ce5b42f Signed-off-by: Ivan Frade <ifrade@google.com>
| * UploadPack: Return correct peer user agent on v2 requestsIvan Frade2018-10-191-12/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UploadPack.getPeerUserAgent() doesn't produce the expected results for protocol v2 requests. In v2, the agent reported in the request (in an "agent=" line) is not in the clientCapabilities but in a field on its own. This makes getPeerUserAgent default to the transport user agent. Making "agent" a shared property between protocol v0/v1 and v2 fixes the problem, simplifies the function and harmonizes the implementation between protocol versions. In a follow up commit the "agent" will be identified on parsing time, instead of taking it from the client capabilities. Change-Id: Idf9825ec4e0b81a1458c8e3701f3e28aafd8a32a Signed-off-by: Ivan Frade <ifrade@google.com>
* | Make PrePushHook properly terminate ref linesMarkus Keller2018-10-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | All of the input lines passed to pre-push hook scripts must be properly terminated by '\n', so that normal shell scripts like the git-supplied pre-push.sample work properly, even when pushing just a single branch. With the old code, hook scripts that use the following pattern didn't process the last line, because 'read' has a non-zero exit status when EOF is encountered: while read local_ref local_sha remote_ref remote_sha; do ... done Change-Id: Id899662ed3fedef6c314fc4b2ddf91a6dcb98cbb Signed-off-by: Markus Keller <markus.kell.r@gmail.com>
* | CheckoutCommand: force flag now allows overwriteNed Twigg2018-10-201-1/+3
|/ | | | | | | | | | | | | | | | | | | | | Before this commit, a force checkout would fail if there were any conflicting files. After this commit, a force checkout will overwrite the conflicting files, as expected. Making this work required fixing a bug in DirCacheCheckout. Before this commit, when DirCacheCheckout had failOnConflict=false, it would delete all conflicting files from the working copy and just leave them missing. After this commit, DirCacheCheckout overwrites conflicting files with the merge tree. This change in DirCacheCheckout causes "reset --hard" and "revert --abort" to behave as expected (previously they would simply delete conflicting files, now they will be overwritten from the merge tree). Change-Id: If7e328ee792ef6511ab7d9c26d8d77c39210ec9f Signed-off-by: Ned Twigg <ned.twigg@diffplug.com>
* Accept protocol v2 server options on fetch and ls-refs requestsIvan Frade2018-10-191-21/+64
| | | | | | | | | | | | | | | | | In protocol v2, a command request can be followed by server options (lines like "agent=<>" and "server-option=<>"), but current code doesn't accept those lines. Advertise the "server-option" capability, parse the lines and add them to the request objects. Other code in JGit can see this options and act accordingly via the protocol v2 hooks. This should not require any change in the client side. Change-Id: If3946390f9cc02d29644b6ca52534b6f757bda9f Signed-off-by: Ivan Frade <ifrade@google.com>
* Configure classpath for separate test sources in EclipseMichael Keppler2018-10-171-4/+20
| | | | | | | | | | | | | | | Eclipse Photon supports separating sources and test sources. There are no functional changes in the IDE, except for test source folders having a different icon color. Users of different IDEs than Eclipse are not affected, since the attribute on the classpath entries will be ignored by their IDE. Bug: 539933 Change-Id: Iac6dcdf0c0730ca775bae90df6a685303dc95380 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de> Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Disable Eclipse warning about unrecognized @SuppressWarnings valueDavid Pursehouse2018-10-171-1/+1
| | | | | | | | | | | | | The code base has several @SuppressWarnings annotations to suppress warnings raised by Error Prone, but those are not recognized by Eclipse and there is currently no way to tell it about them [1]. Suppress them for now. [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=392045 Change-Id: I3de7cfa8ad4370ca5be71e1303879c73ab6829c1 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* UnionInputStreamTest: Suppress ErrorProne warning about missing synchronizedDavid Pursehouse2018-10-171-0/+2
| | | | | | | | | | | | | | | | | | Error Prone reports that the unsynchronized method skip overrides the synchronized method in ByteArrayInputStream [1]. This is a test class, so we can just suppress the warning as recommended in [1]. Note that the suppression causes a warning in Eclipse, because it doesn't recognize the "UnsynchronizedOverridesSynchronized" as a valid value for the @SuppressWarnings annotation [2]. [1] https://errorprone.info/bugpattern/UnsynchronizedOverridesSynchronized [2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=392045 Change-Id: I3e798b448211f1363729091f72fb0ef6a873e599 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Rename Fetch V2 request wantsIds and optionsIvan Frade2018-10-151-8/+8
| | | | | | | | | | | | | In FetchV0Request, the fields "wantsIds" and "options" are called "wantIds" and "clientCapabilities". Those names describe them better. Rename FetchV2Request fields to follow fetch v0. This will make easier to extract a superclass later. Take also the chance to polish the javadoc. Change-Id: Ia17dbbab8084f39cc529fef9ca5c65e189073767 Signed-off-by: Ivan Frade <ifrade@google.com>
* FirstWant: tighten first-want line validationIvan Frade2018-10-121-2/+43
| | | | | | | | | | | First-want line parsing accepts lines with an optional whitespace, when the spec is strict requiring a white space. Validate the line enforcing that there is a white space between oid and capabilities list. Change-Id: I45ada67030e0720f9b402c298be18c7518c799b1 Signed-off-by: Ivan Frade <ifrade@google.com>
* Move first line parsing for v0/v1 pack negotiation out of UploadPackIvan Frade2018-10-122-0/+81
| | | | | | | | | | | | | | | In protocol v0/v1 pack negotiation, the first want line contains the options the client wants in effect. This parsing is done in UploadPack but it doesn't have any interaction with that class. Move the code to its own class and package, mark the current one as deprecated (it is public API) and add unit tests. Take the chance to move the parsing code from the constructor to a factory method, making the class a simple container of results. Change-Id: I1757f535dda78a4111a1c12c3a3b455a4b6f0c51 Signed-off-by: Ivan Frade <ifrade@google.com>
* ValidRefNameTest#testNormalizeBranchName: Fix string/ref equality checkDavid Pursehouse2018-10-101-2/+2
| | | | | Change-Id: Ibffb0dcaab6ec033b1b69aa27ccb7fdaa32fa925 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* DfsFsck: Check that .gitmodules in the repository have valid contentsIvan Frade2018-10-091-0/+55
| | | | | | | | | | | | | | | | Previous commits block the addition to the repo of dangerous .gitmodules files, but some could have been committed before those safeguards where in place. Add a check in DfsFsck to validate the .gitmodules files in the repo. Use the same validation than the ReceivePack, translating the results to FsckErrors. Note that *all* .gitmodules files in the storage will be checked, not only the latest version. Change-Id: I040cf1f31a779419aad0292ba5e6e76eb7f32b66 Signed-off-by: Ivan Frade <ifrade@google.com>
* SubmoduleValidator: Always throw SubmoduleValidationExceptionIvan Frade2018-10-091-3/+2
| | | | | | | | | | | The fsck test needs more detail about the error than an IOException with an explanatory message. Add an error identifier to the SubmoduleValidatorException and make it the only throwable exception when parsing a file. Change-Id: Ic3f0955b497e1681b25e681e1282e876cdf3d2c5 Signed-off-by: Ivan Frade <ifrade@google.com>
* Merge branch 'stable-5.1'Matthias Sohn2018-10-063-2/+210
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.1: Prepare 5.1.3-SNAPSHOT builds JGit v5.1.2.201810061102-r Prepare 4.11.5-SNAPSHOT builds JGit v4.11.4.201810060650-r Fix configuration of maven-javadoc-plugin Prepare 4.9.7-SNAPSHOT builds JGit v4.9.6.201810051924-r Prepare 4.7.6-SNAPSHOT builds JGit v4.7.5.201810051826-r BaseReceivePack: Validate incoming .gitmodules files ObjectChecker: Report .gitmodules files found in the pack SubmoduleAddCommand: Reject submodule URIs that look like cli options Revert "Configure WindowCache settings to use in JGit CLI" Change-Id: I833d30d6de75b097377872c000b2ef5a1b96cf89 Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Prepare 5.1.3-SNAPSHOT buildsMatthias Sohn2018-10-062-47/+47
| | | | | | | | | | Change-Id: I75c1a01885115fc709ab37f181234264c3f7423a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v5.1.2.201810061102-rv5.1.2.201810061102-rMatthias Sohn2018-10-062-2/+2
| | | | | | | | | | Change-Id: Id34e4ae12a796460862edc37c5eb072314199bf4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Merge branch 'stable-5.0' into stable-5.1Matthias Sohn2018-10-063-2/+210
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.0: Prepare 4.11.5-SNAPSHOT builds JGit v4.11.4.201810060650-r Fix configuration of maven-javadoc-plugin Prepare 4.9.7-SNAPSHOT builds JGit v4.9.6.201810051924-r Prepare 4.7.6-SNAPSHOT builds JGit v4.7.5.201810051826-r BaseReceivePack: Validate incoming .gitmodules files ObjectChecker: Report .gitmodules files found in the pack SubmoduleAddCommand: Reject submodule URIs that look like cli options * Fix todos in SubmoduleAddTest Change-Id: I53272081094b8948a40a1ce409af08b6ef330c1e Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * Merge branch 'stable-4.11' into stable-5.0Matthias Sohn2018-10-063-2/+213
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.11: Prepare 4.11.5-SNAPSHOT builds JGit v4.11.4.201810060650-r Fix configuration of maven-javadoc-plugin Prepare 4.9.7-SNAPSHOT builds JGit v4.9.6.201810051924-r Prepare 4.7.6-SNAPSHOT builds JGit v4.7.5.201810051826-r BaseReceivePack: Validate incoming .gitmodules files ObjectChecker: Report .gitmodules files found in the pack SubmoduleAddCommand: Reject submodule URIs that look like cli options * Fix configuration of maven-javadoc-plugin for site generation Change-Id: Ic6ff8d324867ee41f15a5b890c7eee5092e8453e Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | * Prepare 4.11.5-SNAPSHOT buildsMatthias Sohn2018-10-062-47/+47
| | | | | | | | | | | | | | | | | | | | Change-Id: Ifbe76e14264e8b547930e2320e8e81d728bd6e38 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | * JGit v4.11.4.201810060650-rv4.11.4.201810060650-rMatthias Sohn2018-10-062-2/+2
| | | | | | | | | | | | | | | | | | | | Change-Id: I5700ebd341b6b997a7757b17e7d731c4ce608ec2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | * Merge branch 'stable-4.10' into stable-4.11Matthias Sohn2018-10-063-2/+213
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.10: Prepare 4.9.7-SNAPSHOT builds JGit v4.9.6.201810051924-r Prepare 4.7.6-SNAPSHOT builds JGit v4.7.5.201810051826-r BaseReceivePack: Validate incoming .gitmodules files ObjectChecker: Report .gitmodules files found in the pack SubmoduleAddCommand: Reject submodule URIs that look like cli options Change-Id: Ibd759f5d425f714e79b3137ff8e5b0f989933de0 Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | * Merge branch 'stable-4.9' into stable-4.10Matthias Sohn2018-10-063-2/+213
| | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.9: Prepare 4.9.7-SNAPSHOT builds JGit v4.9.6.201810051924-r Prepare 4.7.6-SNAPSHOT builds JGit v4.7.5.201810051826-r BaseReceivePack: Validate incoming .gitmodules files ObjectChecker: Report .gitmodules files found in the pack SubmoduleAddCommand: Reject submodule URIs that look like cli options Change-Id: Ie59e34eb591a827d1ce8e483eec6d390a3c81702 Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | * Prepare 4.9.7-SNAPSHOT buildsMatthias Sohn2018-10-062-47/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I20e7bd6bdebcdb55a8c771314759bd8f98f04ef6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | * JGit v4.9.6.201810051924-rv4.9.6.201810051924-rMatthias Sohn2018-10-062-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ib39aaae26da17aa37d654b24c1defd45126f4ea2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | * Merge branch 'stable-4.8' into stable-4.9Matthias Sohn2018-10-063-2/+213
| | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.8: Prepare 4.7.6-SNAPSHOT builds JGit v4.7.5.201810051826-r BaseReceivePack: Validate incoming .gitmodules files ObjectChecker: Report .gitmodules files found in the pack SubmoduleAddCommand: Reject submodule URIs that look like cli options Change-Id: Ia7a826399d8d5b8a0eb7169b40e98a6f5c207a4c Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | | * Merge branch 'stable-4.7' into stable-4.8Matthias Sohn2018-10-063-3/+214
| | | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.7: Prepare 4.7.6-SNAPSHOT builds JGit v4.7.5.201810051826-r BaseReceivePack: Validate incoming .gitmodules files ObjectChecker: Report .gitmodules files found in the pack SubmoduleAddCommand: Reject submodule URIs that look like cli options Change-Id: Id6fabec4d0b682a7e20a46e88cbc05432efca062 Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | | | * Prepare 4.7.6-SNAPSHOT buildsMatthias Sohn2018-10-062-44/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I99b59116999742d8d6cdba26287ea7c6eba11a30 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | | | * JGit v4.7.5.201810051826-rv4.7.5.201810051826-rMatthias Sohn2018-10-062-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I60c7a2eff3dab5083f71df0d9465a4e94b5e2513 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | | | * BaseReceivePack: Validate incoming .gitmodules filesIvan Frade2018-10-051-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main concern are submodule urls starting with '-' that could pass as options to an unguarded tool. Pass through the parser the ids of blobs identified as .gitmodules files in the ObjectChecker. Load the blobs and parse/validate them in SubmoduleValidator. Change-Id: Ia0cc32ce020d288f995bf7bc68041fda36be1963 Signed-off-by: Ivan Frade <ifrade@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | | | * ObjectChecker: Report .gitmodules files found in the packIvan Frade2018-10-051-2/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to validate .gitmodules files, we first need to find them in the incoming pack. Do it in the ObjectChecker stage. Check in the tree objects if they point to a .gitmodules file and report the tree id and the .gitmodules blob id. This can be used later to check if the file is in the root of the project and if the contents are good. While we're here, make isMacHFSGit more accurate by detecting variants of filenames that vary in case. [jn: tweaked NTFS and HFS+ checking; added more tests] Change-Id: I70802e7d2c1374116149de4f89836b9498f39582 Signed-off-by: Ivan Frade <ifrade@google.com> Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | | | * SubmoduleAddCommand: Reject submodule URIs that look like cli optionsIvan Frade2018-10-051-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In C git versions before 2.19.1, the submodule is fetched by running "git clone <uri> <path>". A URI starting with "-" would be interpreted as an option, causing security problems. See CVE-2018-17456. Refuse to add submodules with URIs, names or paths starting with "-", that could be confused with command line arguments. [jn: backported to JGit 4.7.y, bringing portions of Masaya Suzuki's dotdot check code in v5.1.0.201808281540-m3~57 (Add API to specify the submodule name, 2018-07-12) along for the ride] Change-Id: I2607c3acc480b75ab2b13386fe2cac435839f017 Signed-off-by: Ivan Frade <ifrade@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | | | * Prepare 4.7.5-SNAPSHOT buildsMatthias Sohn2018-09-182-44/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ifce4311fe9429d751cec5b326b540d6233762153 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | | | * JGit v4.7.4.201809180905-rv4.7.4.201809180905-rMatthias Sohn2018-09-182-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Iceee69df5fd593bece4532d5781e3771f5761ef8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | | | * Prepare 4.7.4-SNAPSHOT buildsMatthias Sohn2018-09-092-44/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ie4d17e1604270946606e75145012c5b7fa1283eb Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | | | * JGit v4.7.3.201809090215-rv4.7.3.201809090215-rMatthias Sohn2018-09-092-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I1ded7a2b61235509c5a6ba95e7329e288bbfddb1 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | * | | Prepare 4.9.6-SNAPSHOT buildsMatthias Sohn2018-09-182-47/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I9fb8f6cc45409e0884b898187323ac91953754c3 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | * | | JGit v4.9.5.201809180939-rv4.9.5.201809180939-rMatthias Sohn2018-09-182-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I36199607f3ec6e8bb841e9d9eade12251312447c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>