summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
Commit message (Collapse)AuthorAgeFilesLines
* JGit v4.0.0.201503231230-m1v4.0.0.201503231230-m1Matthias Sohn2015-03-232-2/+2
| | | | | Change-Id: I195239ac3a3f0efbe1409f0ebaad2d1a29c4782e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge bundle org.eclipse.jgit.java7 into org.eclipse.jgitMatthias Sohn2015-03-2310-17/+1177
| | | | | | | As we moved minimum Java version to 7 we don't need a separate bundle and feature for JGit features depending on Java 7 anymore. Change-Id: Ib5da61b0886ddbdea65298f1e8c6d65c9879ced1 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Revert "CommitBuilder should check for duplicate parents"Jonathan Nieder2015-03-182-108/+26
| | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 6bc48cdc62287934ce1b7003280b19a5994e7668. Until git v1.7.10.2~29^2~1 (builtin/merge.c: reduce parents early, 2012-04-17), C git merge would make merge commits with duplicate parents when asked to with a series of commands like the following: git checkout origin/master git merge --no-ff origin/master Nowadays "git merge" removes redundant parents more aggressively (whenever one parent is an ancestor of another and not just when duplicates exist) but merges with duplicate parents are still permitted and can be created with git fast-import or git commit-tree and history viewers need to be able to cope with them. CommitBuilder is an interface analagous to commit-tree, so it should allow duplicate parents. (That said, an option to automatically remove redundant parents would be useful.) Reported-by: Dave Borowitz <dborowitz@google.com> Change-Id: Ia682238397eb1de8541802210fa875fdd50f62f0 Signed-off-by: Jonathan Nieder <jrn@google.com>
* TemporaryBuffer: Allow presizing block pointer listDave Borowitz2015-03-181-0/+25
| | | | | | | | | | | | | | | | | | | | | | | Callers may wish to use TemporaryBuffer as an essentially unbounded buffer by passing Integer.MAX_VALUE as the size. (This makes it behave like ByteArrayOutputStream, only without requiring contiguous memory.) Unfortunately, it was always allocating an array in the backing block pointer list to hold enough blocks to MAX_VALUE--all 262,016 of them. It wasn't allocating the blocks themselves, but this array was still extremely wasteful, using about 2MiB of memory on a 64-bit system. Tweak the interface to specify an estimated size, and only allocate the block pointer list enough entries to hold that size. It's an ArrayList, so if that estimate was wrong, it'll grow. We assume the cost of finding enough contiguous memory to grow that array is acceptable. While we're in there, fix an off-by-one error: due to integer division we were undercounting the number of blocks needed to store n bytes of data as (n / SZ). Change-Id: I794eca3ac4472bcc605b3641e177922aca92b9c0
* CommitBuilder should check for duplicate parentsChristian Halstrick2015-03-122-26/+108
| | | | | | | | | When setting the parents of a commit with setParentIds() or addParentId() it should be checked that we don't have duplicate parents. An IllegalArgumentException should be thrown in this case. Change-Id: I9fa9f31149b7732071b304bca232f037146de454 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
* TestRepository: Allow setting explicit Change-IdDave Borowitz2015-03-121-0/+11
| | | | | | | This includes both leaving existing Change-Ids alone (as, for example Gerrit's commit-msg hook does) and programmatically setting a value. Change-Id: Iaaffb0107ae27de24df1f0e95a8d628fb8ea5364
* TestRepository: Ignore existing Change-Id in messageDave Borowitz2015-03-121-0/+10
| | | | Change-Id: I343c3065fa369ef8aab2b033ac1e392b28d10daf
* TestRepository: Support committing to unborn symrefDave Borowitz2015-03-121-0/+10
| | | | Change-Id: I6bcee635adda7c929f6fa68ef20438fe77e49184
* TestRepository: Add methods to amend commits or refsDave Borowitz2015-03-121-1/+105
| | | | Change-Id: I47082416f6e281262b160ba15272258f9109abd1
* TestRepository: Add a reset method to move HEAD aroundDave Borowitz2015-03-121-0/+83
| | | | | | | | | This flushed out a number of bugs in the way DfsRefUpdate, or at least the InMemoryRepository implementation, processes symrefs. These have been fixed, to an extent, in InMemoryRepository, but other implementations may still suffer from these bugs. Change-Id: Ifd12115a0060b9ff45a88d305b72f91ca0472f9a
* TestRepository: Optionally insert Change-Id in commit messageDave Borowitz2015-03-121-0/+88
| | | | | | Copied the implementation from CommitCommand. Change-Id: Iade0e2d70bde70cfa830fe23bcc41959b011a14a
* Merge "ArchiveCommand: Allow to pass options to underlying stream"Shawn Pearce2015-03-111-3/+38
|\
| * ArchiveCommand: Allow to pass options to underlying streamDavid Ostrovsky2015-02-201-3/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current ArchiveCommand design doesn't allow to pass in options to underlying stream implementations. To overcome this, client has to implement custom format implementation (it cannot be derived from the existing one, because the classes are marked as final), and set the options using ThreadLocal, before the method ArchiveOutputStream createArchiveOutputStream(OutputStream s) is get called. This change extends the ArchiveCommand.Format by allowing to pass option map during creation of ArchiveOutputStream. ArchiveCommand is extended correspondingly. That way client can easily pass options to the underlying streams: Map<String, Object> level = ImmutableMap.<String, Object> of( "level", new Integer(9)); new ArchiveCommand(repo) .setFormat("zip") .setFormatOptions(level) .setTree(tree) .setPaths(paths) .setPrefix(prefix) .setOutputStream(sidebandOut) .call(); Change-Id: I1d92a1e5249117487da39d19c7593e4b812ad97a Signed-off-by: David Ostrovsky <david@ostrovsky.org>
* | Add "--long" option to JGit describeChristian Halstrick2015-03-091-2/+31
| | | | | | | | | | | | | | | | | | | | | | Native git supports "git describe --long". This will enforce returning a long description of a commit even if a tag is directly pointing to the commit (in contrast to just returning the tag name as it is now). This commit teaches JGits DescribeCommand and the describe command in the pgm package to support "--long". Bug: 460991 Change-Id: I65e179b79e89049c6deced3c71cb3ebb08ed0a8f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Add an in-process pack transport for use in testsDave Borowitz2015-02-272-0/+249
| | | | | | | | | | | | | | | | This allows for testing arbitrary sets of push/fetch hooks (e.g. PreReceiveHook) without depending on either an external protocol (e.g. HTTP) or the local filesystem. Change-Id: I4ba2fff9c8a484f990dea05e14b0772deddb7411
* | Merge branch 'stable-3.7'Matthias Sohn2015-02-271-0/+17
|\ \ | |/ |/| | | | | | | | | | | | | | | * stable-3.7: Prepare 3.7.1-SNAPSHOT builds JGit v3.7.0.201502260915-r Read user.name and email from environment first Provide more details in exceptions thrown when packfile is invalid Change-Id: I427f861c6bc94da5e3e05dbbebbf0ad15719a323 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Prepare 3.7.1-SNAPSHOT buildsMatthias Sohn2015-02-272-40/+40
| | | | | | | | | | Change-Id: I2e97610ea9e552e5800e7ca895fd193c8bc507aa Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v3.7.0.201502260915-rv3.7.0.201502260915-rMatthias Sohn2015-02-262-2/+2
| | | | | | | | | | Change-Id: Iec17746cad81cfb1d775e782b30f9d8a13c938b6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Read user.name and email from environment firstMatthias Sohn2015-02-241-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to [1] user name and email are taken first from the environment variables: GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL In case (some of) these environment variables are not set, the information is taken from the git configuration. JGit doesn not yet support the environment variables GIT_AUTHOR_DATE and GIT_COMMITTER_DATE. [1] https://www.kernel.org/pub/software/scm/git/docs/git-commit-tree.html#_commit_information Bug: 460586 Change-Id: I3ba582b4ae13674cf319652b5b13ebcbb96dd8ec Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Move console classes to pgm bundleMatthias Sohn2015-02-103-13/+0
| | | | | | | | | | | | | | | | | | Since we updated minimum Java version to Java 7 the console bundle doesn't need to be a separate bundle anymore. Move the contained classes to the pgm bundle which is using these classes. Change-Id: If8e6f2d7405fdfe6f4b178673b4ccf99c67d4b64 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Set minimum required Java version to Java 7Matthias Sohn2015-02-093-5/+5
| | | | | | | | | | | | Bug: 458475 Change-Id: Iea8f2236d4e6a94a8d14bb8cc685006ea3fd1bb7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge branch 'stable-3.7'Matthias Sohn2015-02-041-0/+68
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.7: Add option --orphan for checkout Prepare post 3.7.0.201502031740-rc1 builds JGit v3.7.0.201502031740-rc1 Support for the pre-commit hook Fix FileUtils.testRelativize_mixedCase which failed on Mac OS X Add a hook test Introduce hook support into the FS implementations If a pack isn't found on disk remove it from pack list Conflicts: org.eclipse.jgit.java7.test/META-INF/MANIFEST.MF Change-Id: I936acd24d47b911fa30ab29856094e1b2c6ac3db Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Prepare post 3.7.0.201502031740-rc1 buildsMatthias Sohn2015-02-042-2/+2
| | | | | | | | Change-Id: Id3728e771a4441757de016cc9d68055f668126b0 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v3.7.0.201502031740-rc1v3.7.0.201502031740-rc1Matthias Sohn2015-02-032-2/+2
| | | | | | | | | | Change-Id: Ia2ea65945b7e1d4120da3d6e6c9f6d5fdb642ae6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Fix FileUtils.testRelativize_mixedCase which failed on Mac OS XMatthias Sohn2015-02-021-19/+8
| | | | | | | | | | | | | | HFS is case insensitive hence expecting it to return the result for case sensitive filesystem doesn't work. Change-Id: I292eab78e50711529a0412f9a54e174a3ac16109 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Introduce hook support into the FS implementationsLaurent Goubet2015-02-021-0/+79
| | | | | | | | | | | | | | | | | | | | | | This introduces the background plumbing necessary to run git hooks from JGit. This implementation will be OS-dependent as it aims to be compatible with existing hooks, mostly written in Shell. It is compatible with unix systems and windows as long as an Unix emulator such as Cygwin is in its PATH. Change-Id: I1f82a5205138fd8032614dd5b52aef14e02238ed Signed-off-by: Laurent Goubet <laurent.goubet@obeo.fr> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Prepare 4.0.0-SNAPSHOT buildsMatthias Sohn2015-01-272-40/+40
|/ | | | | Change-Id: I414ba8ccc82866d3107ba7083a567ea70c879bdf Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix RawText.getLineDelimiter() for empty first lineFrank Wagner2015-01-171-0/+7
| | | | | | Bug: 456776 Change-Id: Iae50be89ea6d5aee33bd938a937ac5ca578aabca Signed-off-by: Frank Wagner <frank.wagner@fr.ibm.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add basic support for .gitattributesArthur Daussy2015-01-076-0/+1250
| | | | | | | | | | | | | | | | | | | | | | Core classes to parse and process .gitattributes files including support for reading attributes in WorkingTreeIterator and the dirCacheIterator. The implementation follows the git ignore implementation. It supports lazy reading attributes while walking the working tree. Bug: 342372 CQ: 9078 Change-Id: I05f3ce1861fbf9896b1bcb7816ba78af35f3ad3d Also-by: Marc Strapetz <marc.strapetz@syntevo.com> Also-by: Gunnar Wagenknecht <gunnar@wagenknecht.org> Also-by: Arthur Daussy <arthur.daussy@obeo.fr> Signed-off-by: Gunnar Wagenknecht <gunnar@wagenknecht.org> Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com> Signed-off-by: Arthur Daussy <arthur.daussy@obeo.fr> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* AIOOB in ChangeIdUtil.indexOfChangeId if amended message is a newlineAndrey Loskutov2015-01-061-0/+4
| | | | | Bug: 456792 Change-Id: Idf38a0db7dc72d672ff185dcac2f41f0012a6673 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
* Merge branch 'stable-3.6'Matthias Sohn2015-01-043-32/+157
|\ | | | | | | | | | | | | | | | | | | | | * stable-3.6: Prepare 3.6.2-SNAPSHOT builds JGit v3.6.1.201501031845-r Trim author/committer name and email in commit header Rename detection should canonicalize line endings PathMatcher should respect "assumeDirectory" flag Change-Id: Idd48c6d94cf1ab09abc07f70d50890b1b78e1833 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Prepare 3.6.2-SNAPSHOT buildsMatthias Sohn2015-01-042-39/+39
| | | | | | | | | | Change-Id: I9699d84af2d4b5382d8ee88ed3517d6b91305421 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v3.6.1.201501031845-rv3.6.1.201501031845-rMatthias Sohn2015-01-042-2/+2
| | | | | | | | | | Change-Id: I56e235a271f90ea2d8cdb7d99706f726d4a59c43 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Trim author/committer name and email in commit headerRĂ¼diger Herrmann2015-01-031-0/+12
| | | | | | | | | | | | | | | | | | | | | | C Git trims name and email before inserting them into the commit header so that " A U Thor " and " author@example.com " becomes "A U Thor <author@example.com>" with a single separating space. This changes PersonIdent#toExternalString() to trim name and email before concatenating them. Change-Id: Idd77b659d0db957626824f6632e2da38d7731625 Signed-off-by: RĂ¼diger Herrmann <ruediger.herrmann@gmx.de>
| * Rename detection should canonicalize line endingsMarc Strapetz2015-01-021-18/+44
| | | | | | | | | | | | | | | | | | | | Native Git canonicalizes line endings when detecting renames, more specifically it replaces CRLF by LF. See: hash_chars in diffcore-delta.c Bug: 449545 Change-Id: Iec2aab12ae9e67074cccb7fbd4d9defe176a0130 Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * PathMatcher should respect "assumeDirectory" flagAndrey Loskutov2014-12-281-14/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The path matcher should not fail if the rule ends with trailing slash, target pattern does not ends with the slash and the "assumeDirectory" flag is set. E.g. */bin/ should also match a/bin if this pattern is threated as directory by WorkingTreeIterator (FileMode.TREE). The old code/tests have never tested directory rules with patterns *without* trailing slashes but with the "assumeDirectory" flag set. Unfortunately this is exactly what WorkingTreeIterator does... The tests are changed to test *both* cases now (with trailing slash and without) if the target pattern has trailing slash (represents directory). Bug: 454672 Change-Id: I621c1644d9e94df3eb9f6f09c6de0fe51f0950a4 Also-by: Markus Duft <markus.duft@salomon.at> Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
* | Prepare 3.7.0-SNAPSHOT buildsMatthias Sohn2014-12-242-39/+39
|/ | | | | Change-Id: Ib3e7b5f46ee1e27b9cf25b3b2d01d681a5c4904c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 3.6.1-SNAPSHOT buildsMatthias Sohn2014-12-232-39/+39
| | | | | Change-Id: Ie620c90ffafbffc6755b4e1ed55a61a15b118a2a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v3.6.0.201412230720-rv3.6.0.201412230720-rMatthias Sohn2014-12-232-2/+2
| | | | | Change-Id: Ic28e2bbbdb1099e948c64a005c39f6b8d8ac69a8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix unit tests for windows by explicitly closing test reposChristian Halstrick2014-12-221-0/+3
| | | | Change-Id: If5f67d739f744f19b45e6f5c7597a213fd5bf025
* Merge branch 'stable-3.5' into stable-3.6Matthias Sohn2014-12-1914-59/+338
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.5: JGit v3.5.3.201412180710-r JGit v3.4.2.201412180340-r ObjectChecker: Disallow names potentially mapping to ".git" on HFS+ ObjectChecker: Disallow Windows shortname "GIT~1" ObjectChecker: Disallow ".git." and ".git<space>" Always ignore case when forbidding .git in ObjectChecker DirCache: Refuse to read files with invalid paths DirCache: Replace isValidPath with DirCacheCheckout.checkValidPath Replace "a." with "a-" in unit tests Apache HttpClientConnection: replace calls to deprecated LocalFile() Fix two nits about DirCacheEntry constructors Detect buffering failures while writing rebase todo file Deprecate TemporaryBuffer.LocalFile without parent directory Switch FileHeader.extractFileLines to TemporaryBuffer.Heap AmazonS3: Buffer pushed pack content under $GIT_DIR DirCache: Buffer TREE extension to $GIT_DIR Change-Id: Iee8acbaa9d4d9047b550641db1b8845d64530785 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v3.5.3.201412180710-rv3.5.3.201412180710-rstable-3.5Matthias Sohn2014-12-182-2/+2
| | | | | | | | | | Change-Id: Iadbd460da494c04fba71f98c200d6b65ce1709c6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Merge branch 'stable-3.4' into stable-3.5Matthias Sohn2014-12-1814-59/+338
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.4: JGit v3.4.2.201412180340-r ObjectChecker: Disallow names potentially mapping to ".git" on HFS+ ObjectChecker: Disallow Windows shortname "GIT~1" ObjectChecker: Disallow ".git." and ".git<space>" Always ignore case when forbidding .git in ObjectChecker DirCache: Refuse to read files with invalid paths DirCache: Replace isValidPath with DirCacheCheckout.checkValidPath Replace "a." with "a-" in unit tests Apache HttpClientConnection: replace calls to deprecated LocalFile() Fix two nits about DirCacheEntry constructors Detect buffering failures while writing rebase todo file Deprecate TemporaryBuffer.LocalFile without parent directory Switch FileHeader.extractFileLines to TemporaryBuffer.Heap AmazonS3: Buffer pushed pack content under $GIT_DIR DirCache: Buffer TREE extension to $GIT_DIR Change-Id: I398cf40b006a05a6537788fc6eb1f84df1ed8814 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * JGit v3.4.2.201412180340-rv3.4.2.201412180340-rstable-3.4Matthias Sohn2014-12-182-2/+2
| | | | | | | | | | | | | | | Change-Id: Ie088cf129b04ec64738edbc8c3ce25aa43b557ca Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * ObjectChecker: Disallow names potentially mapping to ".git" on HFS+Matthias Sohn2014-12-181-0/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mac's HFS+ folds concatentations of ".git" and ignorable Unicode characters [1] to ".git" [2]. Hence we need to disallow all names which could potentially be a shortname for ".git". Example: in an empty directory create a folder ".g\U+200Cit". Now you can't create another folder ".git". The following characters are ignorable Unicode which are ignored on HFS+: unicode hex name ------------------------------------------------- U+200C 0xe2808c ZERO WIDTH NON-JOINER U+200D 0xe2808d ZERO WIDTH JOINER U+200E 0xe2808e LEFT-TO-RIGHT MARK U+200F 0xe2808f RIGHT-TO-LEFT MARK U+202A 0xe280aa LEFT-TO-RIGHT EMBEDDING U+202B 0xe280ab RIGHT-TO-LEFT EMBEDDING U+202C 0xe280ac POP DIRECTIONAL FORMATTING U+202D 0xe280ad LEFT-TO-RIGHT OVERRIDE U+202E 0xe280ae RIGHT-TO-LEFT OVERRIDE U+206A 0xe281aa INHIBIT SYMMETRIC SWAPPING U+206B 0xe281ab ACTIVATE SYMMETRIC SWAPPING U+206C 0xe281ac INHIBIT ARABIC FORM SHAPING U+206D 0xe281ad ACTIVATE ARABIC FORM SHAPING U+206E 0xe281ae NATIONAL DIGIT SHAPES U+206F 0xe281af NOMINAL DIGIT SHAPES U+FEFF 0xefbbbf ZERO WIDTH NO-BREAK SPACE [1] http://www.unicode.org/versions/Unicode7.0.0/ch05.pdf#G40025 http://www.unicode.org/reports/tr31/#Layout_and_Format_Control_Characters [2] http://dubeiko.com/development/FileSystems/HFSPLUS/tn1150.html#UnicodeSubtleties Change-Id: Ib6a1dd090b2649bdd8ec16387c994ed29de2860d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * ObjectChecker: Disallow Windows shortname "GIT~1"Christian Halstrick2014-12-181-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows creates shortnames for all non-8.3 files (see [1]). Hence we need to disallow all names which could potentially be a shortname for ".git". Example: in an empty directory create a folder "GIT~1". Now you can't create another folder ".git". The path "GIT~1" may map to ".git" on Windows. A potential victim to such an attack first has to initialize a git repository in order to receive any git commits. Hence the .git folder created by init will get the shortname "GIT~1". ".git" will only get a different shortname if the user has created a file "GIT~1" before initialization of the git repository. [1] http://en.wikipedia.org/wiki/8.3_filename Change-Id: I9978ab8f2d2951c46c1b9bbde57986d64d26b9b2 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * ObjectChecker: Disallow ".git." and ".git<space>"Shawn Pearce2014-12-182-8/+98
| | | | | | | | | | | | | | | | | | | | | | | | Windows treats "foo." and "foo " as "foo". The ".git" directory is special, as it contains metadata for a local Git repository. Disallow variations that Windows considers to be the same. Change-Id: I28eb48859a95a89111b4987c91de97557e3bb539
| | * Always ignore case when forbidding .git in ObjectCheckerShawn Pearce2014-12-181-16/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The component name ".GIT" inside a tree entry could confuse a case insensitive filesystem into looking at a submodule and not a directory entry. Disallow any case permutations of ".git" to prevent this confusion from entering a repository and showing up at a later date on a case insensitive system. Change-Id: Iaa3f768931d0d5764bf07ac5f6f3ff2b1fdda01b
| | * DirCache: Refuse to read files with invalid pathsShawn Pearce2014-12-181-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | If the DirCache contains a path that is known to be invalid, refuse to read the DirCache into memory. This avoids confusing errors later if an invalid path read from the DirCache were to be passed into a new DirCacheEntry constructor. Change-Id: Ic033d81e23a5fbd554cc4dff80a232504562ffa8
| | * DirCache: Replace isValidPath with DirCacheCheckout.checkValidPathShawn Pearce2014-12-181-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | isValidPath is an older simple form of the validation performed by checkValidPath. Use the latter as it more consistently matches git-core's validation rules. By running the same validation as fsck, callers creating an entry for the DirCache are more likely to learn early they are trying to build trees that will fail fsck. Change-Id: Ibf5ac116097156aa05c18e231bc65c0854932eb1