]> source.dussan.org Git - jgit.git/log
jgit.git
9 years agoAdd an in-process pack transport for use in tests 34/42934/2
Dave Borowitz [Fri, 27 Feb 2015 23:08:50 +0000 (15:08 -0800)]
Add an in-process pack transport for use in tests

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

9 years agoExtract classes for transport within a JGit process 33/42933/1
Dave Borowitz [Fri, 27 Feb 2015 23:04:35 +0000 (15:04 -0800)]
Extract classes for transport within a JGit process

TransportLocal knows how to spin up a thread to allow two repositories
in the same process to communicate using the wire protocol. However,
it is still tied to local on-disk filesystems, and needs to be able to
fork processes if not using the default git-{upload,receive}-pack
implementation.

Extract out the connection classes so they can be used by other
transport implementations.

Change-Id: I5db59086740735508c2e70a597c2d1a89014b072

9 years agoAdd missing since tags for new API 64/42864/1
Matthias Sohn [Fri, 27 Feb 2015 01:33:05 +0000 (02:33 +0100)]
Add missing since tags for new API

Change-Id: I90d4d7566b2e220b8ea8ea1c644fe4b7fa81c0a3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoMerge branch 'stable-3.7' 61/42861/1
Matthias Sohn [Fri, 27 Feb 2015 00:54:12 +0000 (01:54 +0100)]
Merge branch 'stable-3.7'

* 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>
9 years agoPrepare 3.7.1-SNAPSHOT builds 60/42860/1
Matthias Sohn [Fri, 27 Feb 2015 00:41:30 +0000 (01:41 +0100)]
Prepare 3.7.1-SNAPSHOT builds

Change-Id: I2e97610ea9e552e5800e7ca895fd193c8bc507aa
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoJGit v3.7.0.201502260915-r 68/42768/1 v3.7.0.201502260915-r
Matthias Sohn [Thu, 26 Feb 2015 14:13:01 +0000 (15:13 +0100)]
JGit v3.7.0.201502260915-r

Change-Id: Iec17746cad81cfb1d775e782b30f9d8a13c938b6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoMerge "Read user.name and email from environment first" into stable-3.7
Christian Halstrick [Wed, 25 Feb 2015 17:01:40 +0000 (12:01 -0500)]
Merge "Read user.name and email from environment first" into stable-3.7

9 years agoAdd/fix since tags for new API for push certificates 32/42632/1
Matthias Sohn [Wed, 25 Feb 2015 13:18:12 +0000 (14:18 +0100)]
Add/fix since tags for new API for push certificates

This was missed in change I249869cadb2d55aef016371b9311b8583591b9cf

Change-Id: I19c9d4c04b6aa92b9e04c192dee70775d6985b58
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoMerge branch 'stable-3.7' 87/42587/1
Matthias Sohn [Tue, 24 Feb 2015 22:44:56 +0000 (23:44 +0100)]
Merge branch 'stable-3.7'

* stable-3.7:
  Add log4j and slf4j-log4j bridge to jgit feature
  Use slf4j to log instead of printing to System.err
  Use Target Platform Definition DSL to generate target platforms

Change-Id: Ic8779868150c910fa55fd20348e35723e6add0f1

9 years agoRead user.name and email from environment first 13/42413/3
Matthias Sohn [Mon, 23 Feb 2015 12:49:24 +0000 (13:49 +0100)]
Read user.name and email from environment first

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>
9 years agoPort push certificates 30/39530/16
Stefan Beller [Tue, 24 Feb 2015 01:15:43 +0000 (17:15 -0800)]
Port push certificates

Push certificates ("git push --signed") have been part of
git-core since version 2.2.0 (released Nov 26 2014). We also
want to support that feature.

This is not complete and is lacking the actual functionality
to validate the signature for now.

Change-Id: I249869cadb2d55aef016371b9311b8583591b9cf
Signed-off-by: Stefan Beller <sbeller@google.com>
9 years agoProvide more details in exceptions thrown when packfile is invalid 45/41545/3
Matthias Sohn [Tue, 10 Feb 2015 17:23:14 +0000 (18:23 +0100)]
Provide more details in exceptions thrown when packfile is invalid

Mention packfile path in exceptions thrown when we detect that a
packfile is invalid and make excplicit that corrupt packs are removed
from the pack list.

Change-Id: I454ada5f8e69307d3f34d1c1b8f3cb87607ddf35
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoAdd log4j and slf4j-log4j bridge to jgit feature 94/41794/2
Matthias Sohn [Tue, 10 Feb 2015 10:58:19 +0000 (11:58 +0100)]
Add log4j and slf4j-log4j bridge to jgit feature

CQ: 9207
CQ: 9241
Change-Id: Ic06a06da0a74f8fa494c0753cbe9ed2356c21ab3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoUse slf4j to log instead of printing to System.err 68/41468/3
Matthias Sohn [Mon, 9 Feb 2015 20:54:58 +0000 (21:54 +0100)]
Use slf4j to log instead of printing to System.err

CQ: 9206
Bug: 458445
Change-Id: Ic68fb7dbe0fb46bf30f157db45bf18d8f3a704c0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoUse Target Platform Definition DSL to generate target platforms 80/41980/1
Matthias Sohn [Mon, 16 Feb 2015 23:12:01 +0000 (00:12 +0100)]
Use Target Platform Definition DSL to generate target platforms

The "Target Platform Definition DSL and Generator" [1] heavily
simplifies maintenance of target platforms. It allows to modularize
target platform definitions which eliminates code duplication. The
.target files understood by P2 and Tycho are generated from .tpd files
which are written in the target platform definition DSL.

In order to edit .tpd files and generate .target files install the
"Target Platform Definition DSL and Generator" 2.0 or later [2]  (Note:
on Kepler you also need to add [3] to get Xtext 2.5 which is not
available by default on Kepler). This tools is needed only if you need
to change the Target Platform definition files (*.targetplatform and
*.tpd) and re-generate the *.target files. In normal development you do
not need this and can simply use the generated *.target themselves.

In addition
- update Orbit repository for 4.5 to Mars M5
- use latest released Orbit p2 repository for platform version Luna
  and earlier

[1] https://github.com/mbarbero/fr.obeo.releng.targetplatform
[2] http://mbarbero.github.io/fr.obeo.releng.targetplatform/p2/latest/
[3] http://download.eclipse.org/modeling/tmf/xtext/updates/releases/

Change-Id: Ia701972785c3e88aba66a7f15a2b3cf638727eea
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoMove console classes to pgm bundle 26/40426/3
Matthias Sohn [Tue, 27 Jan 2015 00:43:24 +0000 (01:43 +0100)]
Move console classes to pgm bundle

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>
9 years agoImplement AutoClosable interface on classes that used release() 63/40463/6
Matthias Sohn [Tue, 27 Jan 2015 15:06:38 +0000 (16:06 +0100)]
Implement AutoClosable interface on classes that used release()

Implement AutoClosable and deprecate the old release() method to give
JGit consumers some time to adapt.

Bug: 428039
Change-Id: Id664a91dc5a8cf2ac401e7d87ce2e3b89e221458
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoImplement AutoClosable interface to support try-with-resources block 38/40438/5
Matthias Sohn [Tue, 27 Jan 2015 10:14:22 +0000 (11:14 +0100)]
Implement AutoClosable interface to support try-with-resources block

Bug: 428039
Change-Id: I41880862db5303b5bea4b2184ba7844d69c997b5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoSet minimum required Java version to Java 7 25/40425/5
Matthias Sohn [Mon, 26 Jan 2015 23:59:52 +0000 (00:59 +0100)]
Set minimum required Java version to Java 7

Bug: 458475
Change-Id: Iea8f2236d4e6a94a8d14bb8cc685006ea3fd1bb7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoMerge branch 'stable-3.7' 71/41071/1
Matthias Sohn [Wed, 4 Feb 2015 13:21:52 +0000 (14:21 +0100)]
Merge branch 'stable-3.7'

* 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>
9 years agoAdd option --orphan for checkout 69/41069/1
Rüdiger Herrmann [Fri, 30 Jan 2015 23:09:27 +0000 (00:09 +0100)]
Add option --orphan for checkout

Change-Id: I546a93f3e147d8d6fc70094b22679c0d11cd8921
Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de>
9 years agoPrepare post 3.7.0.201502031740-rc1 builds 35/41035/1
Matthias Sohn [Wed, 4 Feb 2015 01:04:02 +0000 (02:04 +0100)]
Prepare post 3.7.0.201502031740-rc1 builds

Change-Id: Id3728e771a4441757de016cc9d68055f668126b0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoJGit v3.7.0.201502031740-rc1 29/41029/1 v3.7.0.201502031740-rc1
Matthias Sohn [Tue, 3 Feb 2015 22:36:31 +0000 (23:36 +0100)]
JGit v3.7.0.201502031740-rc1

Change-Id: Ia2ea65945b7e1d4120da3d6e6c9f6d5fdb642ae6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoSupport for the pre-commit hook 06/40506/3
Laurent Goubet [Fri, 31 Oct 2014 14:20:14 +0000 (15:20 +0100)]
Support for the pre-commit hook

Introduce support for the pre-commit hook into JGit, along with the
--no-verify commit command option to bypass it when rebasing /
cherry-picking.

Change-Id: If86df98577fa56c5c03d783579c895a38bee9d18
Signed-off-by: Laurent Goubet <laurent.goubet@obeo.fr>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoFix FileUtils.testRelativize_mixedCase which failed on Mac OS X 37/40937/2
Matthias Sohn [Mon, 2 Feb 2015 20:21:09 +0000 (21:21 +0100)]
Fix FileUtils.testRelativize_mixedCase which failed on Mac OS X

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>
9 years agoAdd a hook test 05/40505/2
Matthias Sohn [Sun, 25 Jan 2015 00:48:20 +0000 (01:48 +0100)]
Add a hook test

Change-Id: I8059ef299aeb43373f4f45274030886171a20a8e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoIntroduce hook support into the FS implementations 04/40504/2
Laurent Goubet [Fri, 31 Oct 2014 13:58:07 +0000 (14:58 +0100)]
Introduce hook support into the FS implementations

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>
9 years agoIf a pack isn't found on disk remove it from pack list 03/40503/1
Matthias Sohn [Mon, 26 Jan 2015 13:56:25 +0000 (14:56 +0100)]
If a pack isn't found on disk remove it from pack list

If accessing a pack throws FileNotFoundException the pack was deleted
and we need to remove it from the pack list. This can be caused e.g. by
git gc.

Change-Id: I5d10f87f364dadbbdbfb61b6b2cbdee9c7457f3d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoAdd BatchRefUpdate#toString() 87/40387/2
Dave Borowitz [Mon, 26 Jan 2015 19:04:21 +0000 (11:04 -0800)]
Add BatchRefUpdate#toString()

Change-Id: I58c342a91911763055c1073d2f426340fbf94fa4

9 years agoPrepare 4.0.0-SNAPSHOT builds 24/40424/1
Matthias Sohn [Mon, 26 Jan 2015 22:33:14 +0000 (23:33 +0100)]
Prepare 4.0.0-SNAPSHOT builds

Change-Id: I414ba8ccc82866d3107ba7083a567ea70c879bdf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoMerge "Fix integer overflow in DiffFormatter when context is set to large int"
Shawn Pearce [Tue, 27 Jan 2015 05:53:04 +0000 (00:53 -0500)]
Merge "Fix integer overflow in DiffFormatter when context is set to large int"

9 years agoMerge "Make jgit.sh work on windows when JGIT_CLASSPATH is set"
Shawn Pearce [Tue, 27 Jan 2015 05:51:18 +0000 (00:51 -0500)]
Merge "Make jgit.sh work on windows when JGIT_CLASSPATH is set"

9 years agoMerge "Handle invalid tree extensions"
Shawn Pearce [Tue, 27 Jan 2015 05:49:02 +0000 (00:49 -0500)]
Merge "Handle invalid tree extensions"

9 years agoInMemoryRepository: Ensure new ref targets exist in the repo 79/40379/2
Dave Borowitz [Mon, 26 Jan 2015 17:21:05 +0000 (09:21 -0800)]
InMemoryRepository: Ensure new ref targets exist in the repo

ObjectInserter recently learned to read back inserted objects before
they have been flushed. It is in general unsafe to create refs to such
objects, but it is now much more possible to do so, by passing "new
RevWalk(inserter.newReader())" into RefUpdate#execute(RevWalk).

We can't change the RefUpdate interface to remove execute(RevWalk);
nor would we necessarily want to, for performance reasons. And in any
case, RefUpdate#safeParse explicitly ignores MissingObjectExceptions.
But we can enforce object existence in InMemoryRepository, which will
allow callers using this class in their tests to ensure they are using
the RefDatabase correctly.

Change-Id: I5c696ba23bcd2a536a0512fa7f5b6130961905c5

9 years agoHandle invalid tree extensions 39/40339/1
Christian Halstrick [Mon, 26 Jan 2015 10:12:27 +0000 (11:12 +0100)]
Handle invalid tree extensions

In case the index contains wrong tree extensions don't throw a
ArrayIndexOutOfBounds exception but revalidate the tree extension.

It happened that the git index written by Git for Windows contained valid
(means entryCount>0) tree extensions for pathes which are not existing
in the index. Native git handles this inconsistency silently but JGit
was crashing with a ArrayIndexOutOfBounds exception. Teach JGit to
better recognize such cases and revalidate such extensions.

It's hard to write a test because JGit doesn't write such extensions. It
only reads, validates and makes use of them. But the bug tells how to
create such situations.

Bug: 457152
Change-Id: Id3ffd7dc7ae1c55674d88bf1b43953234fe0b68d

9 years agoMerge "Ensure GitCommand's "callable" guard is thread-safe"
Christian Halstrick [Fri, 23 Jan 2015 07:55:06 +0000 (02:55 -0500)]
Merge "Ensure GitCommand's "callable" guard is thread-safe"

9 years agoMerge changes I05be0a5b,Ieee334f4
Christian Halstrick [Fri, 23 Jan 2015 07:54:33 +0000 (02:54 -0500)]
Merge changes I05be0a5b,Ieee334f4

* changes:
  Document that repo returned by SubmoduleAddCommand needs to be closed
  Document that Git instance returned by CloneCommand needs to be closed

9 years agoDocument that repo returned by SubmoduleAddCommand needs to be closed 85/40085/2
Matthias Sohn [Wed, 21 Jan 2015 23:24:30 +0000 (00:24 +0100)]
Document that repo returned by SubmoduleAddCommand needs to be closed

Bug: 448570
Change-Id: I05be0a5b07f8e22f55637b9a3080362978368bcb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoSilence non-externalized string warnings in RepoCommand 86/40086/1
Matthias Sohn [Wed, 21 Jan 2015 23:42:22 +0000 (00:42 +0100)]
Silence non-externalized string warnings in RepoCommand

Change-Id: Ia25543c0d80817f8eb35c667ba5dcce046131a7c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoDocument that Git instance returned by CloneCommand needs to be closed 84/40084/1
Matthias Sohn [Wed, 21 Jan 2015 23:23:13 +0000 (00:23 +0100)]
Document that Git instance returned by CloneCommand needs to be closed

Bug: 448570
Change-Id: Ieee334f4d82cd71ba98b26abb8667e8f64cac665
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoEnsure GitCommand's "callable" guard is thread-safe 82/40082/1
Matthias Sohn [Wed, 21 Jan 2015 22:52:28 +0000 (23:52 +0100)]
Ensure GitCommand's "callable" guard is thread-safe

This way we can ensure that the same command instance can't be used
concurrently in multiple threads.

Bug: 458023
Change-Id: I4884a1ef2f609f9fb24dda4bd5819dffb9f174b6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoMerge remote-tracking branch 'origin/stable-3.6' 77/40077/1
Matthias Sohn [Wed, 21 Jan 2015 21:27:46 +0000 (22:27 +0100)]
Merge remote-tracking branch 'origin/stable-3.6'

* origin/stable-3.6:
  Prepare 3.6.3-SNAPSHOT builds
  JGit v3.6.2.201501210735-r
  Don't remove pack from pack list for problems which could be transient
  Log reason for ignoring pack when IOException occurred

Change-Id: I61141b52839511d58e5a5b193bfde31e9f444a6c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoPrepare 3.6.3-SNAPSHOT builds 51/40051/1 stable-3.6
Matthias Sohn [Wed, 21 Jan 2015 15:48:51 +0000 (16:48 +0100)]
Prepare 3.6.3-SNAPSHOT builds

Change-Id: Ie753dc77a23558d1993e959f48b7eb06557ea686
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoJGit v3.6.2.201501210735-r 24/40024/1 v3.6.2.201501210735-r
Matthias Sohn [Wed, 21 Jan 2015 12:43:30 +0000 (13:43 +0100)]
JGit v3.6.2.201501210735-r

Change-Id: I483fc7bbff1561721cf621dc67ce4a193624fa64
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoDon't remove pack from pack list for problems which could be transient 85/39685/6
Matthias Sohn [Thu, 15 Jan 2015 16:30:11 +0000 (17:30 +0100)]
Don't remove pack from pack list for problems which could be transient

If we hit a corrupt object or invalid pack remove the pack from the pack
list. Other IOException could be transient hence we should not remove
the pack from the list to avoid the problem reported on the Gerrit list
[1]. It looks like in the reported case the pack was removed from the
pack list causing MissingObjectExceptions which disappear when the
server is restarted.

[1] https://groups.google.com/forum/#!topic/repo-discuss/Qdmbl-YZ4NU

Change-Id: I331626110d54b190e46cddc2c40f29ddeb9613cd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoFix RawText.getLineDelimiter() for empty first line 97/39597/3
Frank Wagner [Wed, 14 Jan 2015 15:18:34 +0000 (16:18 +0100)]
Fix RawText.getLineDelimiter() for empty first line

Bug: 456776
Change-Id: Iae50be89ea6d5aee33bd938a937ac5ca578aabca
Signed-off-by: Frank Wagner <frank.wagner@fr.ibm.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoLog reason for ignoring pack when IOException occurred 61/39661/3
Matthias Sohn [Mon, 22 Dec 2014 14:08:15 +0000 (15:08 +0100)]
Log reason for ignoring pack when IOException occurred

This should help to identify the root cause of the problem discussed on
the Gerrit list [1].

[1] https://groups.google.com/forum/#!topic/repo-discuss/Qdmbl-YZ4NU

Change-Id: I871f70e4bb1227952e1544b789013583b14e2b96
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoSilence API warning raised since 7fafd372 96/39496/1
Matthias Sohn [Tue, 13 Jan 2015 15:44:15 +0000 (16:44 +0100)]
Silence API warning raised since 7fafd372

This new git capability isn't yet in the wild in the git-core camp.
Hence we can silence this API warning.

Change-Id: I9e030959f658c58344b04ef2f9edd28060f0c964
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years ago[pgm] Prevent commands from writing progress to System.err 51/39351/3
Rüdiger Herrmann [Sun, 11 Jan 2015 15:20:51 +0000 (16:20 +0100)]
[pgm] Prevent commands from writing progress to System.err

Commands which report progress used to write to System.err. This is not
desirable in cases where jgit.pgm is embedded. This change redirects
progress output to the error stream that is configured by the command.

Change-Id: I01fa5e167437e619448ac201fcb1cbf63bad96d7
Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoUpdate atomic constant 41/39441/1
Stefan Beller [Tue, 13 Jan 2015 00:49:21 +0000 (16:49 -0800)]
Update atomic constant

The atomic feature is now cooking in -next in git-core. Very rarely
features are ejected from the the next branch in git-core, so I consider
it reasonable to come up with this patch now to make the 2 implementations
interoperable.

Change-Id: I806a8ae3c045ca5936f69cb903baf9b99ee39181
Signed-off-by: Stefan Beller <sbeller@google.com>
9 years agoMerge "[pgm] Add missing help text for clone --bare option"
Christian Halstrick [Mon, 12 Jan 2015 10:24:37 +0000 (05:24 -0500)]
Merge "[pgm] Add missing help text for clone --bare option"

9 years agoAdd basic support for .gitattributes 14/1614/24
Arthur Daussy [Thu, 31 Jan 2013 19:27:10 +0000 (20:27 +0100)]
Add basic support for .gitattributes

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>
9 years ago[pgm] Add missing help text for clone --bare option 33/39133/1
Matthias Sohn [Wed, 7 Jan 2015 14:48:52 +0000 (15:48 +0100)]
[pgm] Add missing help text for clone --bare option

Bug: 456695
Change-Id: Ib6005e8453ecc871a9b72227e2593a3823f56010
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoAIOOB in ChangeIdUtil.indexOfChangeId if amended message is a newline 39/39039/1
Andrey Loskutov [Tue, 6 Jan 2015 13:33:07 +0000 (14:33 +0100)]
AIOOB in ChangeIdUtil.indexOfChangeId if amended message is a newline

Bug: 456792
Change-Id: Idf38a0db7dc72d672ff185dcac2f41f0012a6673
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
9 years agoMerge branch 'stable-3.6' 31/38931/1
Matthias Sohn [Sun, 4 Jan 2015 01:18:27 +0000 (02:18 +0100)]
Merge branch 'stable-3.6'

* 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>
9 years agoPrepare 3.6.2-SNAPSHOT builds 30/38930/1
Matthias Sohn [Sun, 4 Jan 2015 00:19:35 +0000 (01:19 +0100)]
Prepare 3.6.2-SNAPSHOT builds

Change-Id: I9699d84af2d4b5382d8ee88ed3517d6b91305421
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoJGit v3.6.1.201501031845-r 27/38927/1 v3.6.1.201501031845-r
Matthias Sohn [Sat, 3 Jan 2015 23:46:52 +0000 (00:46 +0100)]
JGit v3.6.1.201501031845-r

Change-Id: I56e235a271f90ea2d8cdb7d99706f726d4a59c43
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoTrim author/committer name and email in commit header 13/38913/1
Rüdiger Herrmann [Fri, 17 Oct 2014 11:05:41 +0000 (13:05 +0200)]
Trim author/committer name and email in commit header

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>
9 years agoRename detection should canonicalize line endings 12/38912/1
Marc Strapetz [Thu, 30 Oct 2014 18:36:49 +0000 (19:36 +0100)]
Rename detection should canonicalize line endings

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>
9 years agoAdd .mailmap to correct Shawn and Saša's log entries 32/37332/2
Shawn Pearce [Sun, 30 Nov 2014 18:34:36 +0000 (10:34 -0800)]
Add .mailmap to correct Shawn and Saša's log entries

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

9 years agoPathMatcher should respect "assumeDirectory" flag 93/38793/1
Andrey Loskutov [Sun, 14 Dec 2014 17:07:59 +0000 (18:07 +0100)]
PathMatcher should respect "assumeDirectory" flag

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>
9 years agoCompare API changes against 3.6.0 92/38792/1
Matthias Sohn [Sun, 28 Dec 2014 00:53:19 +0000 (01:53 +0100)]
Compare API changes against 3.6.0

Change-Id: I70d2e3f37d02a688436999844884510c2eb5cbda
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoPrepare 3.7.0-SNAPSHOT builds 49/38749/2
Matthias Sohn [Wed, 24 Dec 2014 00:10:23 +0000 (01:10 +0100)]
Prepare 3.7.0-SNAPSHOT builds

Change-Id: Ib3e7b5f46ee1e27b9cf25b3b2d01d681a5c4904c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoMerge branch 'stable-3.6' 48/38748/1
Matthias Sohn [Wed, 24 Dec 2014 00:08:58 +0000 (01:08 +0100)]
Merge branch 'stable-3.6'

* 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>
9 years agoPrepare 3.6.1-SNAPSHOT builds 45/38745/1
Matthias Sohn [Tue, 23 Dec 2014 22:38:20 +0000 (23:38 +0100)]
Prepare 3.6.1-SNAPSHOT builds

Change-Id: Ie620c90ffafbffc6755b4e1ed55a61a15b118a2a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoJGit v3.6.0.201412230720-r 13/38713/2 v3.6.0.201412230720-r
Matthias Sohn [Tue, 23 Dec 2014 12:20:53 +0000 (13:20 +0100)]
JGit v3.6.0.201412230720-r

Change-Id: Ic28e2bbbdb1099e948c64a005c39f6b8d8ac69a8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years ago[pgm] Add option --bare to clone command 81/37381/8
Matthias Sohn [Thu, 4 Dec 2014 00:47:21 +0000 (01:47 +0100)]
[pgm] Add option --bare to clone command

Change-Id: I528491e3e20d3c9ebe37fe3cd2bf85b4644d8698
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years ago[pgm] Implement clone using CloneCommand 26/37526/7
Matthias Sohn [Thu, 4 Dec 2014 00:43:23 +0000 (01:43 +0100)]
[pgm] Implement clone using CloneCommand

Change-Id: I56699b7bf9a71f673cb308d3015f51de5b06c1d9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoMerge "Fix junit tests under windows when the platform is explicitly changed" into...
Matthias Sohn [Mon, 22 Dec 2014 14:29:43 +0000 (09:29 -0500)]
Merge "Fix junit tests under windows when the platform is explicitly changed" into stable-3.6

9 years agoMerge "[pgm] Add option --tags for ls-remote" into stable-3.6
Christian Halstrick [Mon, 22 Dec 2014 14:25:15 +0000 (09:25 -0500)]
Merge "[pgm] Add option --tags for ls-remote" into stable-3.6

9 years agoMerge "[pgm] Add option --heads for ls-remote" into stable-3.6
Christian Halstrick [Mon, 22 Dec 2014 14:23:24 +0000 (09:23 -0500)]
Merge "[pgm] Add option --heads for ls-remote" into stable-3.6

9 years agoFix junit tests under windows when the platform is explicitly changed 67/38667/5
Christian Halstrick [Mon, 22 Dec 2014 10:19:22 +0000 (11:19 +0100)]
Fix junit tests under windows when the platform is explicitly changed

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

9 years agoMerge "[pgm] Use LsRemoteCommand to implement ls-remote and add a test" into stable-3.6
Christian Halstrick [Mon, 22 Dec 2014 11:49:33 +0000 (06:49 -0500)]
Merge "[pgm] Use LsRemoteCommand to implement ls-remote and add a test" into stable-3.6

9 years agoFix unit tests for windows by explicitly closing test repos 66/38666/1
Christian Halstrick [Mon, 22 Dec 2014 09:13:41 +0000 (10:13 +0100)]
Fix unit tests for windows by explicitly closing test repos

Change-Id: If5f67d739f744f19b45e6f5c7597a213fd5bf025

9 years agoMerge branch 'stable-3.6' 75/38575/1
Shawn Pearce [Fri, 19 Dec 2014 15:57:55 +0000 (07:57 -0800)]
Merge branch 'stable-3.6'

* 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

9 years agoMerge "Implement FileSnapshot.toString() to help debugging"
Shawn Pearce [Fri, 19 Dec 2014 15:55:24 +0000 (10:55 -0500)]
Merge "Implement FileSnapshot.toString() to help debugging"

9 years agoMerge branch 'stable-3.5' into stable-3.6 23/38523/1
Matthias Sohn [Thu, 18 Dec 2014 23:17:54 +0000 (00:17 +0100)]
Merge branch 'stable-3.5' into stable-3.6

* 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>
9 years agoJGit v3.5.3.201412180710-r stable-3.5 v3.5.3.201412180710-r
Matthias Sohn [Thu, 18 Dec 2014 14:23:10 +0000 (15:23 +0100)]
JGit v3.5.3.201412180710-r

Change-Id: Iadbd460da494c04fba71f98c200d6b65ce1709c6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoMerge branch 'stable-3.4' into stable-3.5
Matthias Sohn [Thu, 18 Dec 2014 14:18:07 +0000 (15:18 +0100)]
Merge branch 'stable-3.4' into stable-3.5

* 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>
9 years agoJGit v3.4.2.201412180340-r stable-3.4 v3.4.2.201412180340-r
Matthias Sohn [Thu, 18 Dec 2014 08:36:19 +0000 (09:36 +0100)]
JGit v3.4.2.201412180340-r

Change-Id: Ie088cf129b04ec64738edbc8c3ce25aa43b557ca
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoObjectChecker: Disallow names potentially mapping to ".git" on HFS+
Matthias Sohn [Mon, 15 Dec 2014 13:42:04 +0000 (14:42 +0100)]
ObjectChecker: Disallow names potentially mapping to ".git" on HFS+

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>
9 years agoObjectChecker: Disallow Windows shortname "GIT~1"
Christian Halstrick [Wed, 17 Dec 2014 13:36:52 +0000 (14:36 +0100)]
ObjectChecker: Disallow Windows shortname "GIT~1"

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>
9 years agoObjectChecker: Disallow ".git." and ".git<space>"
Shawn Pearce [Mon, 1 Dec 2014 23:01:07 +0000 (15:01 -0800)]
ObjectChecker: Disallow ".git." and ".git<space>"

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

9 years agoAlways ignore case when forbidding .git in ObjectChecker
Shawn Pearce [Mon, 24 Nov 2014 18:27:49 +0000 (10:27 -0800)]
Always ignore case when forbidding .git in ObjectChecker

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

9 years agoDirCache: Refuse to read files with invalid paths
Shawn Pearce [Tue, 25 Nov 2014 19:43:32 +0000 (11:43 -0800)]
DirCache: Refuse to read files with invalid paths

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

9 years agoDirCache: Replace isValidPath with DirCacheCheckout.checkValidPath
Shawn Pearce [Tue, 25 Nov 2014 08:47:48 +0000 (00:47 -0800)]
DirCache: Replace isValidPath with DirCacheCheckout.checkValidPath

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

9 years agoReplace "a." with "a-" in unit tests
Shawn Pearce [Sat, 29 Nov 2014 04:37:18 +0000 (20:37 -0800)]
Replace "a." with "a-" in unit tests

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

9 years ago[pgm] Add option --tags for ls-remote 84/37384/3
Matthias Sohn [Sun, 23 Nov 2014 23:52:45 +0000 (00:52 +0100)]
[pgm] Add option --tags for ls-remote

Bug: 444072
Change-Id: I52b470924609fc201e078d9d232aad257506728d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years ago[pgm] Add option --heads for ls-remote 83/37383/3
Matthias Sohn [Sun, 23 Nov 2014 23:41:39 +0000 (00:41 +0100)]
[pgm] Add option --heads for ls-remote

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>
9 years ago[pgm] Use LsRemoteCommand to implement ls-remote and add a test 82/37382/2
Matthias Sohn [Sun, 23 Nov 2014 22:57:51 +0000 (23:57 +0100)]
[pgm] Use LsRemoteCommand to implement ls-remote and add a test

Change-Id: Ic266f844c23e2519df5770ca56284b26e4cfe1f4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoSupport the new repository layout for submodules 82/37982/4
Christian Halstrick [Wed, 10 Dec 2014 16:54:28 +0000 (17:54 +0100)]
Support the new repository layout for submodules

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

9 years agoAllow explicit configuration of git directory in CloneCommand 81/37981/4
Christian Halstrick [Wed, 10 Dec 2014 16:45:52 +0000 (17:45 +0100)]
Allow explicit configuration of git directory in CloneCommand

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

9 years agoAllow explicit configuration of git directory in InitCommand 33/37833/7
Christian Halstrick [Wed, 10 Dec 2014 16:42:42 +0000 (17:42 +0100)]
Allow explicit configuration of git directory in InitCommand

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

9 years agoMerge "Revert "Extract path info from requests without decoding""
Shawn Pearce [Fri, 12 Dec 2014 23:51:47 +0000 (18:51 -0500)]
Merge "Revert "Extract path info from requests without decoding""

9 years agoRevert "Extract path info from requests without decoding" 79/38179/1
Shawn Pearce [Fri, 12 Dec 2014 21:53:18 +0000 (16:53 -0500)]
Revert "Extract path info from requests without decoding"

This reverts commit 19f869996f27adf59ec507e5f565d8b5619576f3.
Leaving path info encoded confuses applications like Gitiles.
Trying to fix this inside of JGit was maybe the wrong solution.

Change-Id: I8df9ab6233ff513e427701c8a1a66022c19784eb

9 years agoMerge "Fix tests on windows by closing repos" into stable-3.6
Matthias Sohn [Fri, 12 Dec 2014 13:50:20 +0000 (08:50 -0500)]
Merge "Fix tests on windows by closing repos" into stable-3.6

9 years agoFix tests on windows by closing repos 76/38076/2
Christian Halstrick [Thu, 11 Dec 2014 22:25:09 +0000 (23:25 +0100)]
Fix tests on windows by closing repos

Without explicitly closing repos we can't delete the test repositories
on windows.

Change-Id: Id5fa17bd764cbf28703c2f21639d7e969289c2d6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoMerge "Prevent NPE if ref can't be resolved when executing ReflogCommand" into stable-3.6
Christian Halstrick [Fri, 12 Dec 2014 13:31:16 +0000 (08:31 -0500)]
Merge "Prevent NPE if ref can't be resolved when executing ReflogCommand" into stable-3.6

9 years agoRepoCommand should close opened repos 77/38077/2
Christian Halstrick [Thu, 11 Dec 2014 23:34:31 +0000 (00:34 +0100)]
RepoCommand should close opened repos

RepoCommand opend two repos without closing them or returning them to
the caller. This caused certain tests to fail on Windows.

Change-Id: Ia04924aaaad4d16f883b06404c2a85d3f801231f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
9 years agoFix LocalDiskRepositoryTestCase to create correct type of repos 74/38074/2
Christian Halstrick [Thu, 11 Dec 2014 23:59:06 +0000 (00:59 +0100)]
Fix LocalDiskRepositoryTestCase to create correct type of repos

In one place LocalDiskRepositoryTestCase was ignoring the specification
whether to create a bare or non-bare repository. Fix this and fix also
one test which fails now because bare repos don't write reflogs by
default.

Change-Id: I4bcf8cf97c5b46e2f3919809eaa121a8d0e47010
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>