summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge "[pgm] Add missing help text for clone --bare option"Christian Halstrick2015-01-121-0/+1
|\ \ \
| * | | [pgm] Add missing help text for clone --bare optionMatthias Sohn2015-01-071-0/+1
| | | | | | | | | | | | | | | | | | | | Bug: 456695 Change-Id: Ib6005e8453ecc871a9b72227e2593a3823f56010 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | Add basic support for .gitattributesArthur Daussy2015-01-0718-23/+2090
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-062-0/+6
| | | | | | | | | | | | | | | Bug: 456792 Change-Id: Idf38a0db7dc72d672ff185dcac2f41f0012a6673 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
* | | Merge branch 'stable-3.6'Matthias Sohn2015-01-046-57/+203
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-0455-266/+266
| | | | | | | | | | | | | | | Change-Id: I9699d84af2d4b5382d8ee88ed3517d6b91305421 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit v3.6.1.201501031845-rv3.6.1.201501031845-rMatthias Sohn2015-01-0455-59/+59
| | | | | | | | | | | | | | | Change-Id: I56e235a271f90ea2d8cdb7d99706f726d4a59c43 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Trim author/committer name and email in commit headerRüdiger Herrmann2015-01-032-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-022-40/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-282-15/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Add .mailmap to correct Shawn and Saša's log entriesShawn Pearce2015-01-021-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both myself and Saša Živkov have been using different names and email addresses in the JGit history. Configure .mailmap to map to consistent entries for us. Saša Živkov's entries were taken from the Gerrit Code Review .mailmap file. Change-Id: I3fad123c453c3a1e2972ae0616757fd34b003165
* | | Compare API changes against 3.6.0Matthias Sohn2014-12-281-1/+1
| | | | | | | | | | | | | | | Change-Id: I70d2e3f37d02a688436999844884510c2eb5cbda Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Prepare 3.7.0-SNAPSHOT buildsMatthias Sohn2014-12-2455-267/+267
| | | | | | | | | | | | | | | Change-Id: Ib3e7b5f46ee1e27b9cf25b3b2d01d681a5c4904c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Merge branch 'stable-3.6'Matthias Sohn2014-12-2464-408/+640
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.6: Prepare 3.6.1-SNAPSHOT builds JGit v3.6.0.201412230720-r [pgm] Add option --bare to clone command [pgm] Implement clone using CloneCommand Fix junit tests under windows when the platform is explicitly changed Fix unit tests for windows by explicitly closing test repos [pgm] Add option --tags for ls-remote [pgm] Add option --heads for ls-remote [pgm] Use LsRemoteCommand to implement ls-remote and add a test Change-Id: I8f31e76cb7e9416919f37e02c7e51ab1d221df40 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Prepare 3.6.1-SNAPSHOT buildsMatthias Sohn2014-12-2355-266/+266
| | | | | | | | | | | | | | | Change-Id: Ie620c90ffafbffc6755b4e1ed55a61a15b118a2a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit v3.6.0.201412230720-rv3.6.0.201412230720-rMatthias Sohn2014-12-2355-61/+60
| | | | | | | | | | | | | | | Change-Id: Ic28e2bbbdb1099e948c64a005c39f6b8d8ac69a8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | [pgm] Add option --bare to clone commandMatthias Sohn2014-12-222-1/+24
| | | | | | | | | | | | Change-Id: I528491e3e20d3c9ebe37fe3cd2bf85b4644d8698 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | [pgm] Implement clone using CloneCommandMatthias Sohn2014-12-224-120/+169
| | | | | | | | | | | | Change-Id: I56699b7bf9a71f673cb308d3015f51de5b06c1d9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Merge "Fix junit tests under windows when the platform is explicitly ↵Matthias Sohn2014-12-222-5/+15
| |\ \ | | | | | | | | | | | | changed" into stable-3.6
| | * | Fix junit tests under windows when the platform is explicitly changedChristian Halstrick2014-12-222-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SystemReader used a chached ObjectChecker which was instantiated only once. But in case of unit tests where we can change the platform dynamically (e.g. MockSystemReader.setWindows()) this is wrong and caused DirCacheCheckoutMaliciousPathTest. testMaliciousAbsoluteCurDrivePathWindowsOnUnix() to fail. This change allows user of SystemReader to force the creation of a new ObjectChecker. MockSystemReader.setWindows() and .setUnix() make use of this feature. Change-Id: I87458d1dc63c1f5c18979f972b1c1f0d670a9ed8
| * | | Merge "[pgm] Add option --tags for ls-remote" into stable-3.6Christian Halstrick2014-12-223-1/+36
| |\ \ \
| | * | | [pgm] Add option --tags for ls-remoteMatthias Sohn2014-12-163-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | Bug: 444072 Change-Id: I52b470924609fc201e078d9d232aad257506728d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | | | Merge "[pgm] Add option --heads for ls-remote" into stable-3.6Christian Halstrick2014-12-223-1/+16
| |\| | |
| | * | | [pgm] Add option --heads for ls-remoteMatthias Sohn2014-12-163-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TODO: find a way to use option -h which is already captured by TextBuiltin's option --help which also uses the alias -h. Bug: 444072 Change-Id: Ie66584c2fc7fc224014a43cf928547703dd9d213 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | | | Merge "[pgm] Use LsRemoteCommand to implement ls-remote and add a test" into ↵Christian Halstrick2014-12-222-16/+114
| |\| | | | | |/ / | |/| | | | | | stable-3.6
| | * | [pgm] Use LsRemoteCommand to implement ls-remote and add a testMatthias Sohn2014-12-152-16/+114
| | | | | | | | | | | | | | | | Change-Id: Ic266f844c23e2519df5770ca56284b26e4cfe1f4 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.6'Shawn Pearce2014-12-1951-433/+1288
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.6: (26 commits) 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 Support the new repository layout for submodules Allow explicit configuration of git directory in CloneCommand Allow explicit configuration of git directory in InitCommand Fix tests on windows by closing repos RepoCommand should close opened repos Fix LocalDiskRepositoryTestCase to create correct type of repos Prevent NPE if ref can't be resolved when executing ReflogCommand Fix DirCacheCheckout to set correct file length if core.autocrlf=true CheckoutCommand: Fix checking out ours/theirs when no base stage exists Make sure modifications to config-param trustFolderStat are detected Apache HttpClientConnection: replace calls to deprecated LocalFile() ... Change-Id: Ife6f21d64a148dbb0d0d9055356b1568188806fe
| * | | Merge branch 'stable-3.5' into stable-3.6Matthias Sohn2014-12-1925-141/+533
| |\ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-1855-59/+59
| | | | | | | | | | | | | | | | | | | | Change-Id: Iadbd460da494c04fba71f98c200d6b65ce1709c6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * | Merge branch 'stable-3.4' into stable-3.5Matthias Sohn2014-12-1825-141/+533
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-1855-59/+59
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ie088cf129b04ec64738edbc8c3ce25aa43b557ca Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | * | ObjectChecker: Disallow names potentially mapping to ".git" on HFS+Matthias Sohn2014-12-182-0/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-182-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-183-10/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-182-22/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-182-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-183-36/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | | * | Replace "a." with "a-" in unit testsShawn Pearce2014-12-188-29/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows does not like naming files "a.". The trailing "." may be dropped by the filesystem, which is confusing. Even though these tests currently do not write to disk, future tests like them might. Replace "." with "-", which has the same sorting properties that were desirable about ".", but does not have the same limitations. Change-Id: Ie5b7594bf5e79828d1341883c73ddb70123d5055
| | | * | Merge changes Icf0970dd,Ice5ec10a into stable-3.4Christian Halstrick2014-11-262-11/+10
| | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: Fix two nits about DirCacheEntry constructors Detect buffering failures while writing rebase todo file
| | | | * | Fix two nits about DirCacheEntry constructorsShawn Pearce2014-11-251-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Explicitly pass STAGE_0 when creating a DirCacheEntry from String. This matches the immediate next constructor that accepts the int stage argument better, making the code easier to read. Fix a weird line break where the comma was orphaned by itself. Change-Id: Icf0970dd02a63877f9e41b51b982b0265e8b8887
| | | | * | Detect buffering failures while writing rebase todo fileShawn Pearce2014-11-251-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By routing writes through SafeBufferedOutputStream the caller can be alerted to any flush at close failures while writing or appending to the rebase todo script. Switch the character encoding to be done at the line granularity, as this is sufficiently long enough that encoding overheads will not be a bottleneck, but short enough that the amount of temporary data will not cause memory problems for the JVM. Change-Id: Ice5ec10a7cbadc58486d481b92940056f9ffc43a
| | | * | | Apache HttpClientConnection: replace calls to deprecated LocalFile()Matthias Sohn2014-11-261-3/+3
| | | |/ / | | | | | | | | | | | | | | | Change-Id: I79f422e004f386b3f2875de6997e5a0949fff566
| | | * | Deprecate TemporaryBuffer.LocalFile without parent directoryShawn Pearce2014-11-253-14/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Encourage callers to explicitly name a directory to hold any overflow data. Call sites have more information about what is going into the buffer and how it should be protected at the filesystem level than just throwing content to the system wide temporary directory. Callers that still really don't care (or need to care) can pass null for the File argument to have the system directory used. Change-Id: I89009bbee49d3850d42cd82c2c462e51043acda0
| | | * | Switch FileHeader.extractFileLines to TemporaryBuffer.HeapShawn Pearce2014-11-252-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | File contents are processed into a single byte[] for character conversion. The data must fit entirely in memory, so avoid any file IO. Change-Id: I3fe8be2e5f37d5ae953596dda1ed3fe6d4f6aebc
| | | * | AmazonS3: Buffer pushed pack content under $GIT_DIRShawn Pearce2014-11-252-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This applies the same filesystem permissions as the source objects. Users may override in properties files using the tmpdir value. Change-Id: I3ec332cf41f12eae246cfaee9fd792c52cb2908b
| | | * | DirCache: Buffer TREE extension to $GIT_DIRShawn Pearce2014-11-252-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Increase the in-memory buffer for the TREE extension to 5 MiB, and overflow to $GIT_DIR instead of /tmp. Using a larger buffer reduces the chances a repository will overflow and need to spool the extension to disk. Using $GIT_DIR allows the TREE extension contents to have the same file system protections as the final $GIT_DIR/index. Wrap the entire thing in a try/finally to ensure the temp file is deleted from disk after the block has finished using it. To avoid dangling NFS files, LocalFile.destroy() does close the local file before deleting it. Change-Id: I8f871181a4689e3ebf0cdd4fd1769333cf7546c3
| * | | | Support the new repository layout for submodulesChristian Halstrick2014-12-153-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When updating a submodule (e.g. during recursive clone) the repository for the submodule should be located at <gitdir>/modules/<submodule-path> whereas the working tree of the submodule should be located at <working-tree>/<submodule-path> (<gitdir> and <working-tree> are associated to the containing repository). Since CloneCommand has learned about specifying a separate gitdir this is easy to implement in SubmoduleUpdateCommand. Change-Id: I9b56a3dfa50f97f6975c2bb7c97b36296f331b64
| * | | | Allow explicit configuration of git directory in CloneCommandChristian Halstrick2014-12-152-4/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This feature is needed to support the new submodule layout where the .git folder of the submodules is under .git/modules/<submodule>. Change-Id: If5f13426cfd09b7677e23478e9700c8c25a6dae5
| * | | | Allow explicit configuration of git directory in InitCommandChristian Halstrick2014-12-157-11/+230
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Native git's "init" command allows to specify the location of the .git folder with the option "--separate-git-dir". This allows for example to setup repositories with a non-standard layout. E.g. .git folder under /repos/a.git and the worktree under /home/git/a. Both directories contain pointers to the other side: /repos/a.git/config contains core.worktree=/home/git/a . And /home/git/a/.git is a file containing "gitdir: /repos/a.git". This commit adds that option to InitCommand. This feature is needed to support the new submodule layout where the .git folder of the submodules is under .git/modules/<submodule>. Change-Id: I0208f643808bf8f28e2c979d6e33662607775f1f