summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Make ArchiveFormats final and implement equals()Jonathan Nieder2014-04-115-5/+55
| | | | | | | | | | This should make it easier to modify ArchiveCommand to allow an archive format to be registered twice while still noticing if different callers try to register different implementations for the same format. Change-Id: I32261bc8dc1877a853b49e0da0a6e78921791812 Signed-off-by: Jonathan Nieder <jrn@google.com>
* Mark getParent deprecated in CanonicalTreeParserShawn Pearce2014-04-031-0/+1
| | | | | | | @deprecated in Javadoc must be accompanied by @Deprecated annotation on the class member. Change-Id: Ifdf787f496ff3ffd6ffe8f3321d56320cb08454f
* Fix ObjectChecker when normalization is enabledShawn Pearce2014-04-032-3/+12
| | | | | | | | | | | | | When safeForMacOS is enabled the checker verifies a name does not match against another name in the same tree after normalization to NFC. The check was incorrect and failed when the first name was put in, rejecting simple trees containing only one file like "F". Add a test for this simple tree to verify it is accepted. Fix the test for NFC normalization to actually normalize and have a collision. Change-Id: I39e7d71150948872bff6cd2b06bf8dae52aa3c33
* Abbreviate SHA-1s when reporting invalid objectsShawn Pearce2014-04-031-1/+2
| | | | | | | The full 40 digit name is rather long. In most cases an abbreviated name should be sufficient. Change-Id: Id16a37c6c745ede1fa0d97c5bc390491799500bc
* Throw CorruptObjectException when a bad object is foundShawn Pearce2014-04-032-3/+19
| | | | | | This makes it easier to identify higher in the call stack. Change-Id: I829431c38c71fa1899e33916252b75f09db8ecbd
* Merge "Add missing space to invalid object error messages"Matthias Sohn2014-04-031-1/+1
|\
| * Add missing space to invalid object error messagesShawn Pearce2014-04-031-1/+1
| | | | | | | | | | | | | | | | | | "Invalid tree aa6f10291050a00de83b4630783030b9e3b969ec:duplicate entry names" is hard to read. A space after the object name and before the message makes the message more readable. Change-Id: I96406100dbef8e4bc8fe2047d102681194dc8847
* | Avoid calls to System.exit() and throw an exception insteadGuillaume Nodet2014-04-023-2/+37
| | | | | | | | | | | | | | | | The exception is caught in Main and System.exit() is called. Bug: 413522 Change-Id: Ibe68f7104d4fd55b832000a7840c07a169e7dd58 Signed-off-by: Guillaume Nodet <gnodet@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Add an input stream and an error stream to TextBuiltin base classGuillaume Nodet2014-03-3010-52/+88
| | | | | | | | | | | | | | | | Leverage these streams to remove calls to System.in and System.err Bug: 413522 Change-Id: I8396f3e273c93e23861e8bcfb2ab8182fb09220d Signed-off-by: Guillaume Nodet <gnodet@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Add launchers for running tests with Java 8Robin Rosenberg2014-03-293-0/+78
| | | | | | | | Change-Id: I91a7225cff350f11cc224129439622c7dfd9f4f3 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Make sure we include the Java 7 module in tests when using JDK 8Robin Rosenberg2014-03-293-3/+3
| | | | | | | | Change-Id: Idfb3b16725d8f2ad25338dd0910fb1334c00cde4
* | Cleanup javadocs so they pass the java8 doclint checksRobin Rosenberg2014-03-2935-84/+102
| | | | | | | | | | | | Bug: 431552 Change-Id: I469316f5645205016e1fa6b0fbd2ff3b509b14bc Signed-off-by: Robin Stocker <robin@nibor.org>
* | Allow full compiles on Java 8.Alexander Kurtakov2014-03-281-3/+2
|/ | | | | | | | | | Make jgit.java6 and jgit.java7 activation based on ranges so modules in jgit.java6 are enabled for Java 1.6+ and modules in jgit.java7 are enabled for Java 1.7+. This enables full compiles on Java 8 and also removes the need to list org.eclipse.jgit.console in both profiles. Change-Id: Iabfcff18737ff435ba8d5e8efc7a581abc9a46ce Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
* Interactive rebase: Fix order of commit messages on squashStefan Lay2014-03-272-8/+8
| | | | | | | Bug: 431214 Change-Id: I295bfdc5751545b046d7fe7efc3f8b39ab4f5415 Signed-off-by: Stefan Lay <stefan.lay@sap.com> Signed-off-by: Robin Rosennberg <robin.rosenberg@dewire.com>
* Fix missing NON-NLS tag in RebaseCommandStefan Lay2014-03-271-1/+1
| | | | Change-Id: Ied3e7ec0d825416226cacb2f14d5bca003af36da Signed-off-by: Stefan Lay <stefan.lay@sap.com>
* Fix GarbageCollection not to pack HEADChristian Halstrick2014-03-262-1/+69
| | | | | | | | | | When working on a non-bare repository with a detached HEAD jgit's GC was packing the ref named "HEAD" into the packed-refs file and deleted the loose ref (the file .git/HEAD!). This made the repo unusable for native git. This is fixed by telling jgit to only pack refs starting from "refs/" Change-Id: I50018aa006f18b244d2cae2ff78b5ffe1b821d63
* Fix NameRevCommand when repo has no annotated tagsDave Borowitz2014-03-252-5/+24
| | | | | | | | | | | | Previously, calling addAnnotatedTags() did not modify any state when there were no annotated tags in the repository. This caused the code to assume no addFoo() methods had been called, and fell back to the default of adding refs/*. Instead, use null to indicate neither addRefs() nor addAnnotatedTags() was called. Add a test for this behavior. Change-Id: I9926e5ac17e1a983cd399798993031c72bd79c2c
* Merge branch 'stable-3.3'Matthias Sohn2014-03-254-14/+25
|\ | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.3: Prepare 3.3.2-SNAPSHOT builds JGit v3.3.1.201403241930-r Retry to call credentials provider if http authentication failed Ensure that ssh authentication is retried only in JGit [findBugs] Ensure streams are closed in a finally block Update com.jcraft.jsch to 0.1.50 also in pom dependencies Change-Id: I45b48a3f2dc8c7708e9518645d72bc5645002836 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Prepare 3.3.2-SNAPSHOT buildsMatthias Sohn2014-03-2555-258/+258
| | | | | | | | | | Change-Id: I48271980a258acd0ada7c418b24c61c1bf0a0cd2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v3.3.1.201403241930-rv3.3.1.201403241930-rMatthias Sohn2014-03-2555-59/+59
| | | | | | | | | | Change-Id: Ib317903898095d205f0b6ed4cead62ff6eabd894 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Retry to call credentials provider if http authentication failedMatthias Sohn2014-03-201-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | If the user provided wrong credentials or credentials changed we shouldn't give up immediately but retry to get valid credentials from the credentials provider. Reset the credentials provider if authentication failed to avoid it reuses wrong credentials in case it stored them in a persistent store. Bug: 338048 Bug: 342592 Bug: 427735 Change-Id: Ibd62ef3da17be6454991c43f524c8bbc7ca3c37e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Ensure that ssh authentication is retried only in JGitChristian Halstrick2014-03-151-0/+3
| | | | | | | | | | | | | | | | | | | | JGit wants to control retries during ssh authentication. But JSch by default already retries 6 times. Hence disable retries in JSch. Without this the credentials provider isn't reset if e.g. wrong credentials are specified. Bug: 430210 Change-Id: I6fa726a14a84b06411e7010608c7a1e2bfb8bfe8
| * [findBugs] Ensure streams are closed in a finally blockMatthias Sohn2014-03-112-10/+16
| | | | | | | | Change-Id: I3137eba00d6eba96ca9051b6687fcf62e0871bcc Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Update com.jcraft.jsch to 0.1.50 also in pom dependenciesMatthias Sohn2014-03-111-1/+1
| | | | | | | | | | | | | | | | | | | | 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>
* | Update build to use Tycho 0.20.0Matthias Sohn2014-03-181-1/+1
| | | | | | | | Change-Id: I96d279d45ca9e31a1031b25cb4e5650e1d5525ea Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge "Fix text alignment in history plot renderer"Matthias Sohn2014-03-132-2/+155
|\ \
| * | Fix text alignment in history plot rendererRüdiger Herrmann2014-03-132-2/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When more than one lane is drawn, some commits are vertically misaligned (off by two pixels). This change fixes the alignment. Bug: 426047 Change-Id: Icbe7ce9f5a6b281b2aaab66e4d76dfc1010b2fb5 Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de> Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Fix StackOverflowError in RevCommit.carryFlags on deep side graphsShawn Pearce2014-03-131-16/+63
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Copying flags through a graph with deep side branches can cause StackOverflowError. The recursive step to visit the 2nd parent of a merge commit can overflow the stack if these are themselves very deep histories with many branches. Rewrite the loop to iterate up to 500 recursive steps deep before unwinding the stack and running the remaining parts of the graph using a dynamically allocated FIFORevQueue. This approach still allows simple graphs that mostly merge short lived topic branches into master to copy flags with no dynamic memory allocation, relying only on temporary stack extensions. Larger more complex graphs only pay the allocation penalities if copying has to extend outwards "very far" in the graph, which is unlikely for many coloring based algorithms. Change-Id: I1882e6832c916e27dd5f6b7602d9caf66fb39c84
* | Display progress while checking connectivity on pushShawn Pearce2014-03-121-0/+10
| | | | | | | | | | | | | | | | | | | | Verifying 100 new objects are fully connected to the existing DAG is usually very cheap. Checking the entire Linux kernel history is fully connected when pushing it to a new repository can take 30-60 seconds. Display a progress counter during this time so the client knows the server is still working. Change-Id: Iababe3ee1d35cb82f2bef2f12da7a2ecd03282b0
* | Merge changes ↵Shawn Pearce2014-03-125-159/+567
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I1a225c1b,Ie4d5f082,I41f24363,I9440dd25,I170b6f64,I02e964d1,Iec6ce9e6,Ic700ea8f,Ic3042444,I90a1eaf2,I66eaee5c,Ib921dfd7 * changes: Allow configuration of receive pack's ObjectChecker through fsck.* Correct fetch to use fetch.fsckObjects and transfer.fsckObjects Default receive.fsckObjects to transfer.fsckObjects Allow ReceivePack callers to configure their own ObjectChecker Check for duplicate names after folding case in ObjectChecker Change DirCacheCheckout to verify path using ObjectChecker Reject mixed case .git on Mac OS in ObjectChecker Reject special Windows device names in ObjectChecker Allow an ObjectChecker to reject special characters for Windows Reject '.git' as a tree name in ObjectChecker Extract path segment check function in ObjectChecker Permit ObjectChecker to optionally accept leading '0' in trees
| * | Allow configuration of receive pack's ObjectChecker through fsck.*Shawn Pearce2014-03-121-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fsck.allowLeadingZeroFileMode may be set true to permit pushing broken trees with leading '0' in the file mode. fsck.safeForWindows may be set true to require new trees to have only file names that are safe on the Windows platform. fsck.safeForMacOS may be set true to require new trees to have only file names that do not cause collisions or confusion on the Mac OS platform. Change-Id: I1a225c1b3cd13c0d1a0d43fffe79355c501f49b7
| * | Correct fetch to use fetch.fsckObjects and transfer.fsckObjectsShawn Pearce2014-03-121-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | git-core configures fsck during fetch using these two variables. JGit use of fsck in fetch predates the usage in git-core and had reused receive.fsckobjects, which does not match behavior. Change-Id: Ie4d5f082258c4b2928c7ecc3780c6363fa587f34
| * | Default receive.fsckObjects to transfer.fsckObjectsShawn Pearce2014-03-121-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | ReceivePack should configure itself with receive.fsckObjects, and if not defined, transfer.fsckObjects. This is the order used by git-core. Change-Id: I41f243633dacb606dbcc3132972f63bbaba174d1
| * | Allow ReceivePack callers to configure their own ObjectCheckerShawn Pearce2014-03-121-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | PackParser permits supplying a specific ObjectChecker instance. Allow this to be passed through ReceivePack, giving the caller more flexibility to configure the implementation. Change-Id: I9440dd25588008626222f33bfd697f57c05b439e
| * | Check for duplicate names after folding case in ObjectCheckerShawn Pearce2014-03-122-1/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | Mac OS X and Windows filesystems are generally case insensitive and will fold 'a' and 'A' to the same directory entry. If the checker is enforcing safe semantics for these platforms, track all names and look for duplicates after folding case and normalizing to NFC. Change-Id: I170b6f649a72d6ef322b7254943d4c604a8d25b9
| * | Change DirCacheCheckout to verify path using ObjectCheckerShawn Pearce2014-03-123-145/+83
| | | | | | | | | | | | | | | | | | | | | | | | Reuse the generic logic in ObjectChecker to examine paths. This required extracting the scanner loop to check for bad characters within the path name segment. Change-Id: I02e964d114fb544a0c1657790d5367c3a2b09dff
| * | Reject mixed case .git on Mac OS in ObjectCheckerShawn Pearce2014-03-122-2/+32
| | | | | | | | | | | | | | | | | | | | | | | | Most Mac OS X systems use a case insensitive HFS+ volume. Like Windows ".git" and ".GIT" are the same path and can confuse a Git program into expecting a repository where one does not exist. Change-Id: Iec6ce9e6c2872f8b0850cc6aec023fa0fcb05ae4
| * | Reject special Windows device names in ObjectCheckerShawn Pearce2014-03-122-4/+90
| | | | | | | | | | | | | | | | | | | | | | | | If Windows rejection is enabled reject special device names like NUL and PRN, including NUL.txt. This prevents a tree that might be used on a Windows client from referencing a confusing name. Change-Id: Ic700ea8fa68724509e0357d4b758a41178c4d70c
| * | Allow an ObjectChecker to reject special characters for WindowsShawn Pearce2014-03-122-2/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Repositories that are frequently checked out on Windows platforms may need to ensure trees do not contain strange names that cause problems on those systems. Follow the MSDN guidelines and refuse to accept a tree containing a special character, or names that end with " " (space) or "." (dot). Since Windows filesystems are usually case insensitive, also reject mixed case versions of the reserved ".git" name. Change-Id: Ic3042444b1e162c6d01b88c7e6ea39b2a73c4eca
| * | Reject '.git' as a tree name in ObjectCheckerShawn Pearce2014-03-122-4/+30
| | | | | | | | | | | | | | | | | | | | | | | | Using .git as a name in a tree is invalid for most Git repositories. This can confuse clients into thinking there is a submodule or another repository deeper in the tree, which is incorrect. Change-Id: I90a1eaf25d45e91557f3f548b69cdcd8f7cddce1
| * | Extract path segment check function in ObjectCheckerShawn Pearce2014-03-121-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | Start pulling out the path segment checking. This will be used later to support DirCacheCheckout verification of paths, after folding that logic into this location. Change-Id: I66eaee5c988eb7d425fb7a708ef6f5419ab77348
| * | Permit ObjectChecker to optionally accept leading '0' in treesShawn Pearce2014-03-122-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The leading '0' is a broken mode that although incorrect in the Git canonical tree format was created by a couple of libraries frequently used on a popular Git hosting site. Some projects have these modes stuck in their ancient history and cannot easily repair the damage without a full history rewrite. Optionally permit ObjectChecker to ignore them. Bug: 307291 Change-Id: Ib921dfd77ce757e89280d1c00328a88430daef35
* | | Merge "Rename test class so it is also executed during maven test phase"Matthias Sohn2014-03-121-1/+1
|\ \ \
| * | | Rename test class so it is also executed during maven test phaseChristian Halstrick2014-03-121-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One specific test was executed when running tests from inside eclipse (e.g. by using one of our checked in launch configurations). But when running tests from maven this test was not executed. Maven (the surefire plugin) looks for Tests only in java files which are named like "Test*.java", "*Test.java" or "*TestCase.java". Tests in files named "*Tests.java" are not found. Change-Id: I62a80fd6e6fda8bd76fdf3f3f2b8cbc56460fb2c
* / / Cleanup catch Exception when making Java7FSFactoryShawn Pearce2014-03-111-4/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | Catching Exception and rethrowing as Error when the Java7 factory was not available threw an unexpected error to the caller, but then confused things by still setting the factory to the default Java 5 version. A second call to FS.detect(Boolean) would succeed. Do not throw to the caller. Instead always default to the Java5 factory if the Java7 one is not loading. Change-Id: I6e9edb257b404d213ff08c44560fdb1672a5c80b
* | Take core.autocrlf into account for blame annotationsKonrad Kügler2014-03-102-2/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Blaming with core.autocrlf set to 'true' - even for freshly checked out files - showed all lines as being locally modified. For autocrlf = true the line breaks of the local file will be converted to LF for blaming. This results in useful diffs and therefor in the desired blame annotations. For autocrlf = input no conversion takes place to cope with CRLF line breaks in the repository, in addition to the usual LF. For autocrlf = true CRLF line breaks in the repo can't be supported without additional effort. In that case the whole local file will be blamed as being locally modified. Change-Id: If020dcca54d16b2fb79210a070b8480aec82e58e Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* | Catch UnsupportedOperationException for older WindowsesRobin Rosenberg2014-03-091-1/+1
| | | | | | | | | | Bug: 429947 Change-Id: I78d38b345726f62841db34f7091812a91bf21b4b
* | Add missing breakRobin Rosenberg2014-03-091-0/+1
| | | | | | | | | | | | It does not really matter functionally, but it looked bad, Change-Id: Icb5b73b38fcaa19f7d1c5a0235c3e8dd125b888b
* | Remove a redundant semi-colonRobin Rosenberg2014-03-081-1/+1
| | | | | | | | Change-Id: Id9a1d0036e3fb33aad8b5cb342197457f33febca
* | Add @since tag to new DirCache#findEntryRobin Rosenberg2014-03-081-0/+1
| | | | | | | | Change-Id: Ia58efd178a4571c013bf1104d1da956a86fd7029 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>