]> source.dussan.org Git - jgit.git/log
jgit.git
10 years agoUpdate Software User Agreement 21/24921/2
Matthias Sohn [Sun, 13 Apr 2014 21:27:45 +0000 (23:27 +0200)]
Update Software User Agreement

Bug: 431255
Change-Id: I8a44028d8c48ddd1b9d2f9ef4af4d417c5454881

10 years agoMerge changes Id9a641dd,If2ee1f42
Robin Rosenberg [Wed, 9 Apr 2014 20:14:28 +0000 (16:14 -0400)]
Merge changes Id9a641dd,If2ee1f42

* changes:
  Added TestCase for 7d5e1f Fixed RevWalk.isMergedInto()
  Fixed RevWalk.isMergedInto() returning wrong results

10 years agoAdded TestCase for 7d5e1f Fixed RevWalk.isMergedInto() 49/24549/2
Sven Selberg [Mon, 24 Mar 2014 17:05:32 +0000 (18:05 +0100)]
Added TestCase for 7d5e1f Fixed RevWalk.isMergedInto()

Change-Id: Id9a641dd67c4182bb3a0dc83a6864fee43e7653f
Signed-off-by: Gustaf Lundh <gustaf.lundh@sonymobile.com>
Signed-off-by: Sven Selberg <sven.selberg@sonymobile.com>
10 years agoFix ValidRefNameTest on Windows 00/24000/3
Robin Rosenberg [Sun, 30 Mar 2014 09:00:36 +0000 (11:00 +0200)]
Fix ValidRefNameTest on Windows

There are certain ref names which native git can be create only on
non-windows systems (e.g. "refs/tags/>"). On Windows systems we can't
persist this refs because the ref names are not valid file names. Our
tests in ValidRefNameTest assumed that these are valid refs on all
systems. This broke the tests on Windows.

Change-Id: Ic53c396c88b84cbdf579a636953f7519952270c0

10 years agoFix FileTreeIteratorTest#testIsModifiedFileSmudged() on Windows 60/24160/2
Robin Rosenberg [Sat, 29 Mar 2014 20:59:26 +0000 (21:59 +0100)]
Fix FileTreeIteratorTest#testIsModifiedFileSmudged() on Windows

This would be a problem for any OS where Java lets the subscond
part through to the File API. The fix is to force the timetamp
of the index rather than trusting it to just happen to be right.

Bug: 430765
Change-Id: Id6b3ba003f58427a3ffaacd224649e2d6c93566b
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
10 years agoDon't use package private classes when overriding a public interface 15/24415/3
Robin Rosenberg [Fri, 4 Apr 2014 05:30:15 +0000 (07:30 +0200)]
Don't use package private classes when overriding a public interface

Change-Id: If8522d4e02254766e3310a70e42badafa5ab9768
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
10 years agoMark getParent deprecated in CanonicalTreeParser 11/24411/1
Shawn Pearce [Thu, 3 Apr 2014 19:08:07 +0000 (12:08 -0700)]
Mark getParent deprecated in CanonicalTreeParser

@deprecated in Javadoc must be accompanied by @Deprecated annotation
on the class member.

Change-Id: Ifdf787f496ff3ffd6ffe8f3321d56320cb08454f

10 years agoFix ObjectChecker when normalization is enabled 10/24410/2
Shawn Pearce [Thu, 3 Apr 2014 17:24:49 +0000 (10:24 -0700)]
Fix ObjectChecker when normalization is enabled

When safeForMacOS is enabled the checker verifies a name does not
match against another name in the same tree after normalization to
NFC. The check was incorrect and failed when the first name was put
in, rejecting simple trees containing only one file like "F".

Add a test for this simple tree to verify it is accepted.
Fix the test for NFC normalization to actually normalize
and have a collision.

Change-Id: I39e7d71150948872bff6cd2b06bf8dae52aa3c33

10 years agoAbbreviate SHA-1s when reporting invalid objects 08/24408/2
Shawn Pearce [Thu, 3 Apr 2014 17:12:53 +0000 (10:12 -0700)]
Abbreviate SHA-1s when reporting invalid objects

The full 40 digit name is rather long. In most cases an abbreviated
name should be sufficient.

Change-Id: Id16a37c6c745ede1fa0d97c5bc390491799500bc

10 years agoThrow CorruptObjectException when a bad object is found 07/24407/2
Shawn Pearce [Thu, 3 Apr 2014 17:10:01 +0000 (10:10 -0700)]
Throw CorruptObjectException when a bad object is found

This makes it easier to identify higher in the call stack.

Change-Id: I829431c38c71fa1899e33916252b75f09db8ecbd

10 years agoMerge "Add missing space to invalid object error messages"
Matthias Sohn [Thu, 3 Apr 2014 17:54:15 +0000 (13:54 -0400)]
Merge "Add missing space to invalid object error messages"

10 years agoAdd missing space to invalid object error messages 06/24406/1
Shawn Pearce [Thu, 3 Apr 2014 17:11:30 +0000 (10:11 -0700)]
Add missing space to invalid object error messages

"Invalid tree aa6f10291050a00de83b4630783030b9e3b969ec:duplicate entry names"

is hard to read. A space after the object name and before the message
makes the message more readable.

Change-Id: I96406100dbef8e4bc8fe2047d102681194dc8847

10 years agoAvoid calls to System.exit() and throw an exception instead 82/21182/7
Guillaume Nodet [Fri, 21 Mar 2014 14:53:44 +0000 (15:53 +0100)]
Avoid calls to System.exit() and throw an exception instead

The exception is caught in Main and System.exit() is called.

Bug: 413522
Change-Id: Ibe68f7104d4fd55b832000a7840c07a169e7dd58
Signed-off-by: Guillaume Nodet <gnodet@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoAdd an input stream and an error stream to TextBuiltin base class 81/21181/6
Guillaume Nodet [Tue, 28 Jan 2014 09:19:59 +0000 (10:19 +0100)]
Add an input stream and an error stream to TextBuiltin base class

Leverage these streams to remove calls to System.in and System.err

Bug: 413522
Change-Id: I8396f3e273c93e23861e8bcfb2ab8182fb09220d
Signed-off-by: Guillaume Nodet <gnodet@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoAdd launchers for running tests with Java 8 42/24142/3
Robin Rosenberg [Sat, 29 Mar 2014 09:24:18 +0000 (10:24 +0100)]
Add launchers for running tests with Java 8

Change-Id: I91a7225cff350f11cc224129439622c7dfd9f4f3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMake sure we include the Java 7 module in tests when using JDK 8 41/24141/4
Robin Rosenberg [Sat, 29 Mar 2014 09:20:26 +0000 (10:20 +0100)]
Make sure we include the Java 7 module in tests when using JDK 8

Change-Id: Idfb3b16725d8f2ad25338dd0910fb1334c00cde4

10 years agoCleanup javadocs so they pass the java8 doclint checks 43/24143/4
Robin Rosenberg [Sat, 29 Mar 2014 09:29:29 +0000 (10:29 +0100)]
Cleanup javadocs so they pass the java8 doclint checks

Bug: 431552
Change-Id: I469316f5645205016e1fa6b0fbd2ff3b509b14bc
Signed-off-by: Robin Stocker <robin@nibor.org>
10 years agoAllow full compiles on Java 8. 67/24067/1
Alexander Kurtakov [Fri, 28 Mar 2014 13:43:10 +0000 (15:43 +0200)]
Allow full compiles on Java 8.

Make jgit.java6 and jgit.java7 activation based on ranges so modules in
jgit.java6 are enabled for Java 1.6+ and modules in jgit.java7 are
enabled for Java 1.7+. This enables full compiles on Java 8 and also
removes the need to list org.eclipse.jgit.console in both profiles.

Change-Id: Iabfcff18737ff435ba8d5e8efc7a581abc9a46ce
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
10 years agoInteractive rebase: Fix order of commit messages on squash 02/24002/3
Stefan Lay [Thu, 27 Mar 2014 15:18:42 +0000 (16:18 +0100)]
Interactive rebase: Fix order of commit messages on squash

Bug: 431214
Change-Id: I295bfdc5751545b046d7fe7efc3f8b39ab4f5415
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
Signed-off-by: Robin Rosennberg <robin.rosenberg@dewire.com>
10 years agoFix missing NON-NLS tag in RebaseCommand 91/23991/1
Stefan Lay [Thu, 27 Mar 2014 13:38:29 +0000 (14:38 +0100)]
Fix missing NON-NLS tag in RebaseCommand

Change-Id: Ied3e7ec0d825416226cacb2f14d5bca003af36da
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
10 years agoFix GarbageCollection not to pack HEAD 25/23925/1
Christian Halstrick [Wed, 26 Mar 2014 14:27:48 +0000 (15:27 +0100)]
Fix GarbageCollection not to pack HEAD

When working on a non-bare repository with a detached HEAD jgit's GC was
packing the ref named "HEAD" into the packed-refs file and deleted the
loose ref (the file .git/HEAD!). This made the repo unusable for native
git. This is fixed by telling jgit to only pack refs starting from
"refs/"

Change-Id: I50018aa006f18b244d2cae2ff78b5ffe1b821d63

10 years agoFix NameRevCommand when repo has no annotated tags 04/23904/2
Dave Borowitz [Wed, 26 Mar 2014 01:34:54 +0000 (18:34 -0700)]
Fix NameRevCommand when repo has no annotated tags

Previously, calling addAnnotatedTags() did not modify any state when
there were no annotated tags in the repository. This caused the code
to assume no addFoo() methods had been called, and fell back to the
default of adding refs/*. Instead, use null to indicate neither
addRefs() nor addAnnotatedTags() was called.

Add a test for this behavior.

Change-Id: I9926e5ac17e1a983cd399798993031c72bd79c2c

10 years agoMerge branch 'stable-3.3' 47/23847/1
Matthias Sohn [Tue, 25 Mar 2014 10:03:56 +0000 (11:03 +0100)]
Merge branch 'stable-3.3'

* stable-3.3:
  Prepare 3.3.2-SNAPSHOT builds
  JGit v3.3.1.201403241930-r
  Retry to call credentials provider if http authentication failed
  Ensure that ssh authentication is retried only in JGit
  [findBugs] Ensure streams are closed in a finally block
  Update com.jcraft.jsch to 0.1.50 also in pom dependencies

Change-Id: I45b48a3f2dc8c7708e9518645d72bc5645002836
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoPrepare 3.3.2-SNAPSHOT builds 36/23836/1
Matthias Sohn [Tue, 25 Mar 2014 08:17:23 +0000 (09:17 +0100)]
Prepare 3.3.2-SNAPSHOT builds

Change-Id: I48271980a258acd0ada7c418b24c61c1bf0a0cd2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoJGit v3.3.1.201403241930-r 27/23827/1 v3.3.1.201403241930-r
Matthias Sohn [Mon, 24 Mar 2014 23:32:12 +0000 (00:32 +0100)]
JGit v3.3.1.201403241930-r

Change-Id: Ib317903898095d205f0b6ed4cead62ff6eabd894
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoFixed RevWalk.isMergedInto() returning wrong results 18/23818/1
Gustaf Lundh [Mon, 24 Mar 2014 17:05:32 +0000 (18:05 +0100)]
Fixed RevWalk.isMergedInto() returning wrong results

Under certain circumstances isMergedInto() returned
false even though base is reachable from the tip.
This will hinder pushes and receives by falsely
detecting "non fast forward" merges.

      o---o---o---o---o
      /                 \
     /   o---o---A---o---M
    /   /
---2---1-

if M (tip) was compared to 1 (base), the method
isMergedInto() could still return false, since
two mergeBases will be detected and the return
statement will only look at one of them:

  return next() == base;

In most cases this would pass, but if "A" is
a commit with an old timestamp, the Generator
would walk down to "2" before completing the
walk pass "A" and first finding the other
merge base "1". In this case, the first call to
next() returns 2, which compared to base evaluates
as false.

This is fixed by iterating merge bases and
returning true if base is found among them.

Change-Id: If2ee1f4270f5ea4bee73ecb0e9c933f8234818da
Signed-off-by: Gustaf Lundh <gustaf.lundh@sonymobile.com>
Signed-off-by: Sven Selberg <sven.selberg@sonymobile.com>
10 years agoRetry to call credentials provider if http authentication failed 41/23441/4
Matthias Sohn [Sat, 15 Mar 2014 09:49:22 +0000 (10:49 +0100)]
Retry to call credentials provider if http authentication failed

If the user provided wrong credentials or credentials changed we
shouldn't give up immediately but retry to get valid credentials from
the credentials provider. Reset the credentials provider if
authentication failed to avoid it reuses wrong credentials in
case it stored them in a persistent store.

Bug: 338048
Bug: 342592
Bug: 427735
Change-Id: Ibd62ef3da17be6454991c43f524c8bbc7ca3c37e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoUpdate build to use Tycho 0.20.0 15/23515/1
Matthias Sohn [Mon, 17 Mar 2014 23:07:38 +0000 (00:07 +0100)]
Update build to use Tycho 0.20.0

Change-Id: I96d279d45ca9e31a1031b25cb4e5650e1d5525ea
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoEnsure that ssh authentication is retried only in JGit 01/23401/2
Christian Halstrick [Fri, 14 Mar 2014 15:21:46 +0000 (16:21 +0100)]
Ensure that ssh authentication is retried only in JGit

JGit wants to control retries during ssh authentication. But JSch by
default already retries 6 times. Hence disable retries in JSch. Without
this the credentials provider isn't reset if e.g. wrong credentials are
specified.

Bug: 430210
Change-Id: I6fa726a14a84b06411e7010608c7a1e2bfb8bfe8

10 years agoMerge "Fix text alignment in history plot renderer"
Matthias Sohn [Thu, 13 Mar 2014 22:56:40 +0000 (18:56 -0400)]
Merge "Fix text alignment in history plot renderer"

10 years agoFix text alignment in history plot renderer 14/23314/2
Rüdiger Herrmann [Thu, 13 Mar 2014 10:30:20 +0000 (11:30 +0100)]
Fix text alignment in history plot renderer

When more than one lane is drawn, some commits are vertically misaligned
(off by two pixels). This change fixes the alignment.

Bug: 426047
Change-Id: Icbe7ce9f5a6b281b2aaab66e4d76dfc1010b2fb5
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoFix StackOverflowError in RevCommit.carryFlags on deep side graphs 51/23351/2
Shawn Pearce [Thu, 13 Mar 2014 19:45:57 +0000 (12:45 -0700)]
Fix StackOverflowError in RevCommit.carryFlags on deep side graphs

Copying flags through a graph with deep side branches can cause
StackOverflowError. The recursive step to visit the 2nd parent of
a merge commit can overflow the stack if these are themselves very
deep histories with many branches.

Rewrite the loop to iterate up to 500 recursive steps deep before
unwinding the stack and running the remaining parts of the graph
using a dynamically allocated FIFORevQueue.

This approach still allows simple graphs that mostly merge short
lived topic branches into master to copy flags with no dynamic
memory allocation, relying only on temporary stack extensions.
Larger more complex graphs only pay the allocation penalities
if copying has to extend outwards "very far" in the graph, which
is unlikely for many coloring based algorithms.

Change-Id: I1882e6832c916e27dd5f6b7602d9caf66fb39c84

10 years agoDisplay progress while checking connectivity on push 98/23298/2
Shawn Pearce [Thu, 13 Mar 2014 00:13:10 +0000 (17:13 -0700)]
Display progress while checking connectivity on push

Verifying 100 new objects are fully connected to the existing DAG
is usually very cheap. Checking the entire Linux kernel history is
fully connected when pushing it to a new repository can take 30-60
seconds. Display a progress counter during this time so the client
knows the server is still working.

Change-Id: Iababe3ee1d35cb82f2bef2f12da7a2ecd03282b0

10 years agoMerge changes I1a225c1b,Ie4d5f082,I41f24363,I9440dd25,I170b6f64,I02e964d1,Iec6ce9e6...
Shawn Pearce [Thu, 13 Mar 2014 03:18:32 +0000 (23:18 -0400)]
Merge changes I1a225c1b,Ie4d5f082,I41f24363,I9440dd25,I170b6f64,I02e964d1,Iec6ce9e6,Ic700ea8f,Ic3042444,I90a1eaf2,I66eaee5c,Ib921dfd7

* changes:
  Allow configuration of receive pack's ObjectChecker through fsck.*
  Correct fetch to use fetch.fsckObjects and transfer.fsckObjects
  Default receive.fsckObjects to transfer.fsckObjects
  Allow ReceivePack callers to configure their own ObjectChecker
  Check for duplicate names after folding case in ObjectChecker
  Change DirCacheCheckout to verify path using ObjectChecker
  Reject mixed case .git on Mac OS in ObjectChecker
  Reject special Windows device names in ObjectChecker
  Allow an ObjectChecker to reject special characters for Windows
  Reject '.git' as a tree name in ObjectChecker
  Extract path segment check function in ObjectChecker
  Permit ObjectChecker to optionally accept leading '0' in trees

10 years agoAllow configuration of receive pack's ObjectChecker through fsck.* 97/23297/2
Shawn Pearce [Thu, 13 Mar 2014 00:04:08 +0000 (17:04 -0700)]
Allow configuration of receive pack's ObjectChecker through fsck.*

fsck.allowLeadingZeroFileMode may be set true to permit pushing
broken trees with leading '0' in the file mode.

fsck.safeForWindows may be set true to require new trees to have
only file names that are safe on the Windows platform.

fsck.safeForMacOS may be set true to require new trees to have
only file names that do not cause collisions or confusion on the
Mac OS platform.

Change-Id: I1a225c1b3cd13c0d1a0d43fffe79355c501f49b7

10 years agoCorrect fetch to use fetch.fsckObjects and transfer.fsckObjects 89/23289/2
Shawn Pearce [Wed, 12 Mar 2014 23:53:26 +0000 (16:53 -0700)]
Correct fetch to use fetch.fsckObjects and transfer.fsckObjects

git-core configures fsck during fetch using these two variables.
JGit use of fsck in fetch predates the usage in git-core and had
reused receive.fsckobjects, which does not match behavior.

Change-Id: Ie4d5f082258c4b2928c7ecc3780c6363fa587f34

10 years agoDefault receive.fsckObjects to transfer.fsckObjects 88/23288/2
Shawn Pearce [Wed, 12 Mar 2014 23:44:59 +0000 (16:44 -0700)]
Default receive.fsckObjects to transfer.fsckObjects

ReceivePack should configure itself with receive.fsckObjects,
and if not defined, transfer.fsckObjects. This is the order
used by git-core.

Change-Id: I41f243633dacb606dbcc3132972f63bbaba174d1

10 years agoAllow ReceivePack callers to configure their own ObjectChecker 87/23287/1
Shawn Pearce [Wed, 12 Mar 2014 23:36:07 +0000 (16:36 -0700)]
Allow ReceivePack callers to configure their own ObjectChecker

PackParser permits supplying a specific ObjectChecker instance.
Allow this to be passed through ReceivePack, giving the caller
more flexibility to configure the implementation.

Change-Id: I9440dd25588008626222f33bfd697f57c05b439e

10 years agoCheck for duplicate names after folding case in ObjectChecker 80/23280/2
Shawn Pearce [Wed, 12 Mar 2014 20:59:29 +0000 (13:59 -0700)]
Check for duplicate names after folding case in ObjectChecker

Mac OS X and Windows filesystems are generally case insensitive and
will fold 'a' and 'A' to the same directory entry. If the checker is
enforcing safe semantics for these platforms, track all names and
look for duplicates after folding case and normalizing to NFC.

Change-Id: I170b6f649a72d6ef322b7254943d4c604a8d25b9

10 years agoChange DirCacheCheckout to verify path using ObjectChecker 30/23230/3
Shawn Pearce [Wed, 12 Mar 2014 19:01:56 +0000 (12:01 -0700)]
Change DirCacheCheckout to verify path using ObjectChecker

Reuse the generic logic in ObjectChecker to examine paths.
This required extracting the scanner loop to check for bad
characters within the path name segment.

Change-Id: I02e964d114fb544a0c1657790d5367c3a2b09dff

10 years agoReject mixed case .git on Mac OS in ObjectChecker 77/23277/2
Shawn Pearce [Wed, 12 Mar 2014 19:38:13 +0000 (12:38 -0700)]
Reject mixed case .git on Mac OS in ObjectChecker

Most Mac OS X systems use a case insensitive HFS+ volume. Like
Windows ".git" and ".GIT" are the same path and can confuse a Git
program into expecting a repository where one does not exist.

Change-Id: Iec6ce9e6c2872f8b0850cc6aec023fa0fcb05ae4

10 years agoReject special Windows device names in ObjectChecker 29/23229/3
Shawn Pearce [Wed, 12 Mar 2014 05:49:36 +0000 (22:49 -0700)]
Reject special Windows device names in ObjectChecker

If Windows rejection is enabled reject special device names like
NUL and PRN, including NUL.txt. This prevents a tree that might
be used on a Windows client from referencing a confusing name.

Change-Id: Ic700ea8fa68724509e0357d4b758a41178c4d70c

10 years agoMerge "Rename test class so it is also executed during maven test phase"
Matthias Sohn [Wed, 12 Mar 2014 22:48:29 +0000 (18:48 -0400)]
Merge "Rename test class so it is also executed during maven test phase"

10 years agoAllow an ObjectChecker to reject special characters for Windows 27/23227/3
Shawn Pearce [Wed, 12 Mar 2014 04:19:23 +0000 (21:19 -0700)]
Allow an ObjectChecker to reject special characters for Windows

Repositories that are frequently checked out on Windows platforms
may need to ensure trees do not contain strange names that cause
problems on those systems. Follow the MSDN guidelines and refuse
to accept a tree containing a special character, or names that end
with " " (space) or "." (dot).

Since Windows filesystems are usually case insensitive, also reject
mixed case versions of the reserved ".git" name.

Change-Id: Ic3042444b1e162c6d01b88c7e6ea39b2a73c4eca

10 years agoReject '.git' as a tree name in ObjectChecker 26/23226/3
Shawn Pearce [Wed, 12 Mar 2014 03:12:07 +0000 (20:12 -0700)]
Reject '.git' as a tree name in ObjectChecker

Using .git as a name in a tree is invalid for most Git repositories.
This can confuse clients into thinking there is a submodule or another
repository deeper in the tree, which is incorrect.

Change-Id: I90a1eaf25d45e91557f3f548b69cdcd8f7cddce1

10 years agoExtract path segment check function in ObjectChecker 25/23225/2
Shawn Pearce [Wed, 12 Mar 2014 00:42:01 +0000 (17:42 -0700)]
Extract path segment check function in ObjectChecker

Start pulling out the path segment checking. This will be used
later to support DirCacheCheckout verification of paths, after
folding that logic into this location.

Change-Id: I66eaee5c988eb7d425fb7a708ef6f5419ab77348

10 years agoPermit ObjectChecker to optionally accept leading '0' in trees 24/23224/3
Shawn Pearce [Wed, 12 Mar 2014 00:19:37 +0000 (17:19 -0700)]
Permit ObjectChecker to optionally accept leading '0' in trees

The leading '0' is a broken mode that although incorrect in the
Git canonical tree format was created by a couple of libraries
frequently used on a popular Git hosting site. Some projects have
these modes stuck in their ancient history and cannot easily
repair the damage without a full history rewrite. Optionally permit
ObjectChecker to ignore them.

Bug: 307291
Change-Id: Ib921dfd77ce757e89280d1c00328a88430daef35

10 years agoRename test class so it is also executed during maven test phase 55/23255/1
Christian Halstrick [Wed, 12 Mar 2014 14:52:38 +0000 (15:52 +0100)]
Rename test class so it is also executed during maven test phase

One specific test was executed when running tests from inside eclipse
(e.g. by using one of our checked in launch configurations). But when
running tests from maven this test was not executed. Maven (the surefire
plugin) looks for Tests only in java files which are named like
"Test*.java", "*Test.java" or "*TestCase.java". Tests in files named
"*Tests.java" are not found.

Change-Id: I62a80fd6e6fda8bd76fdf3f3f2b8cbc56460fb2c

10 years agoCleanup catch Exception when making Java7FSFactory 22/23222/1
Shawn Pearce [Tue, 11 Mar 2014 21:57:27 +0000 (14:57 -0700)]
Cleanup catch Exception when making Java7FSFactory

Catching Exception and rethrowing as Error when the Java7 factory was
not available threw an unexpected error to the caller, but then
confused things by still setting the factory to the default Java
5 version.  A second call to FS.detect(Boolean) would succeed.

Do not throw to the caller. Instead always default to the Java5
factory if the Java7 one is not loading.

Change-Id: I6e9edb257b404d213ff08c44560fdb1672a5c80b

10 years ago[findBugs] Ensure streams are closed in a finally block 00/23200/3
Matthias Sohn [Tue, 11 Mar 2014 15:25:25 +0000 (16:25 +0100)]
[findBugs] Ensure streams are closed in a finally block

Change-Id: I3137eba00d6eba96ca9051b6687fcf62e0871bcc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoUpdate com.jcraft.jsch to 0.1.50 also in pom dependencies 18/23218/1
Matthias Sohn [Wed, 5 Mar 2014 07:46:11 +0000 (08:46 +0100)]
Update com.jcraft.jsch to 0.1.50 also in pom dependencies

We updated the target platforms in 3.3 following the version shipped
by the release train but missed to update it in pom dependencies.
This wasn't harmful as there were no API changes between 0.1.46 and
0.1.50.

Change-Id: Ie8ac2ea447fa93d6643b9817f58767ab7f0b1aa4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoTake core.autocrlf into account for blame annotations 43/20543/4
Konrad Kügler [Sun, 12 Jan 2014 12:39:18 +0000 (13:39 +0100)]
Take core.autocrlf into account for blame annotations

Blaming with core.autocrlf set to 'true' - even for freshly checked out
files - showed all lines as being locally modified. For autocrlf = true
the line breaks of the local file will be converted to LF for blaming.
This results in useful diffs and therefor in the desired blame
annotations.

For autocrlf = input no conversion takes place to cope with CRLF line
breaks in the repository, in addition to the usual LF. For autocrlf =
true CRLF line breaks in the repo can't be supported without additional
effort. In that case the whole local file will be blamed as being
locally modified.

Change-Id: If020dcca54d16b2fb79210a070b8480aec82e58e
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
10 years agoCatch UnsupportedOperationException for older Windowses 91/23091/1
Robin Rosenberg [Sun, 9 Mar 2014 11:09:19 +0000 (12:09 +0100)]
Catch UnsupportedOperationException for older Windowses

Bug: 429947
Change-Id: I78d38b345726f62841db34f7091812a91bf21b4b

10 years agoAdd missing break 88/23088/1
Robin Rosenberg [Sat, 8 Mar 2014 13:30:28 +0000 (14:30 +0100)]
Add missing break

It does not really matter functionally, but it looked bad,

Change-Id: Icb5b73b38fcaa19f7d1c5a0235c3e8dd125b888b

10 years agoRemove a redundant semi-colon 80/23080/2
Robin Rosenberg [Sat, 8 Mar 2014 13:08:05 +0000 (14:08 +0100)]
Remove a redundant semi-colon

Change-Id: Id9a1d0036e3fb33aad8b5cb342197457f33febca

10 years agoAdd @since tag to new DirCache#findEntry 79/23079/2
Robin Rosenberg [Sat, 8 Mar 2014 13:05:43 +0000 (14:05 +0100)]
Add @since tag to new DirCache#findEntry

Change-Id: Ia58efd178a4571c013bf1104d1da956a86fd7029
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoImplement "git branch --contains" in pgm 20/20620/3
Robin Stocker [Tue, 14 Jan 2014 16:46:26 +0000 (17:46 +0100)]
Implement "git branch --contains" in pgm

Bug: 425678
Change-Id: Ib59e05a0bde58562cc61e6e3000df761660b468e
Signed-off-by: Robin Stocker <robin@nibor.org>
10 years agoFix default profile for target platform used in maven build 28/22928/2
Christian Halstrick [Wed, 5 Mar 2014 13:15:01 +0000 (14:15 +0100)]
Fix default profile for target platform used in maven build

Change-Id: I10aef3a3b5c3b3ab9f6ef857a9fcc67ce0b1cec3

10 years agoFix some wrong @since 3.3 tags which should be @since 3.4 67/23067/1
Matthias Sohn [Fri, 7 Mar 2014 20:30:58 +0000 (21:30 +0100)]
Fix some wrong @since 3.3 tags which should be @since 3.4

Change-Id: Idafe6e041cc40a00ac52eb4ba88753c49db86988
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years ago[findBugs] Declare some private methods of WorkingTreeIterator static 04/22704/3
Matthias Sohn [Fri, 28 Feb 2014 10:48:20 +0000 (11:48 +0100)]
[findBugs] Declare some private methods of WorkingTreeIterator static

Change-Id: I09cd39c367f408b5a963ff004f235f558990f338
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoUpdate com.jcraft.jsch to 0.1.50 also in pom dependencies 01/22901/1
Matthias Sohn [Wed, 5 Mar 2014 07:46:11 +0000 (08:46 +0100)]
Update com.jcraft.jsch to 0.1.50 also in pom dependencies

We updated the target platforms in 3.3 following the version shipped
by the release train but missed to update it in pom dependencies.
This wasn't harmful as there were no API changes between 0.1.46 and
0.1.50.

Change-Id: Ie8ac2ea447fa93d6643b9817f58767ab7f0b1aa4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoPrepare 3.4.0-SNAPSHOT builds 93/22893/1
Matthias Sohn [Wed, 5 Mar 2014 01:14:08 +0000 (02:14 +0100)]
Prepare 3.4.0-SNAPSHOT builds

Change-Id: I907c6f1834c06b8ab4d3e0f76dde475faea7b4a5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge branch 'stable-3.3' 92/22892/1
Matthias Sohn [Wed, 5 Mar 2014 01:02:03 +0000 (02:02 +0100)]
Merge branch 'stable-3.3'

* stable-3.3:
  Update scripts to deploy jgit on Maven central
  Prepare 3.3.1-SNAPSHOT builds
  JGit v3.3.0.201403021825-r
  Fix merge/cherry-picking in CRLF mode
  Expose the received pack size in ReceivePack
  Revert "Add getPackFile to ReceivePack to make PostReceiveHook more usable"
  Avoid an NPE after 7b01a5369210
  Add a launcher for Java 7 tests
  Remove obsolete getRepositoryMethod from WorkingTreeIterator
  Fix NPE when WorkingTreeIterator does not have a repository set
  Add getPackFile to ReceivePack to make PostReceiveHook more usable
  Possibility to limit the max pack size on receive-pack
  Package httpclient and httpcore in o.e.j.http.apache.feature

Change-Id: I814a150980854bbaabd767f97b062d247af6cb50
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoUpdate scripts to deploy jgit on Maven central 89/22889/1
Matthias Sohn [Tue, 4 Mar 2014 23:43:21 +0000 (00:43 +0100)]
Update scripts to deploy jgit on Maven central

Change-Id: I760ad82f2455cfc2cdc76c9331a03b09aebb2349
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoPrepare 3.3.1-SNAPSHOT builds 88/22888/1
Matthias Sohn [Tue, 4 Mar 2014 23:20:11 +0000 (00:20 +0100)]
Prepare 3.3.1-SNAPSHOT builds

Change-Id: If15560f2731e54dbf9db88d8a308b4c25ce27e8e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge "Add setContains to ListBranchCommand (branch --contains)"
Robin Rosenberg [Mon, 3 Mar 2014 23:10:44 +0000 (18:10 -0500)]
Merge "Add setContains to ListBranchCommand (branch --contains)"

10 years agoMerge "DirCache.findEntry(byte[], in) made public"
Robin Rosenberg [Mon, 3 Mar 2014 22:56:10 +0000 (17:56 -0500)]
Merge "DirCache.findEntry(byte[], in) made public"

10 years agoMerge "Windows: Test that we can create a symlink before the target is created"
Robin Rosenberg [Mon, 3 Mar 2014 22:54:05 +0000 (17:54 -0500)]
Merge "Windows: Test that we can create a symlink before the target is created"

10 years agoAdd missing @Deprecated to deprecated fields and methods 03/22803/1
Shawn Pearce [Mon, 3 Mar 2014 18:37:06 +0000 (10:37 -0800)]
Add missing @Deprecated to deprecated fields and methods

Java spec requires the @Deprecated annotation on any deprecated
field or method. Add the missing annotation to fields and methods
already declared deprecated in the javadoc.

Change-Id: Ic0ef24b43cfd99ac947e771ef5a28e493c304274

10 years agoJGit v3.3.0.201403021825-r 35/22735/1 v3.3.0.201403021825-r
Matthias Sohn [Sun, 2 Mar 2014 23:26:54 +0000 (00:26 +0100)]
JGit v3.3.0.201403021825-r

Change-Id: Iaf3da455f7d6f691617299e881154ff8185a9d46
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoFix merge/cherry-picking in CRLF mode 60/22060/3
Robin Rosenberg [Sun, 15 Dec 2013 15:57:01 +0000 (16:57 +0100)]
Fix merge/cherry-picking in CRLF mode

This fixes a case where we have CRLF in the repo but
LF in the worktree and are in autocrlf mode.

Change-Id: I0388270c1cf0fd22dfd513bcaa404eb97268d39d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge "Expose the received pack size in ReceivePack" into stable-3.3
Robin Rosenberg [Sun, 2 Mar 2014 13:17:18 +0000 (08:17 -0500)]
Merge "Expose the received pack size in ReceivePack" into stable-3.3

10 years agoMerge "Revert "Add getPackFile to ReceivePack to make PostReceiveHook more usable...
Robin Rosenberg [Sun, 2 Mar 2014 13:14:14 +0000 (08:14 -0500)]
Merge "Revert "Add getPackFile to ReceivePack to make PostReceiveHook more usable"" into stable-3.3

10 years agoExpose the received pack size in ReceivePack 16/22716/2
Saša Živkov [Fri, 28 Feb 2014 17:34:59 +0000 (18:34 +0100)]
Expose the received pack size in ReceivePack

PostReceiveHooks can make use of this information to, for example,
update a cached size of the Git repository.

Change-Id: I2bf1200959a50531e2155a7609c96035ba45b10d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoRevert "Add getPackFile to ReceivePack to make PostReceiveHook more 17/22717/1
Saša Živkov [Fri, 28 Feb 2014 12:47:40 +0000 (13:47 +0100)]
Revert "Add getPackFile to ReceivePack to make PostReceiveHook more
usable"

This reverts commit 2670fd427cd4aad49ccdb6dde66271fdffff86f8.

By returning an instance of File from the ReceivePack.getPackFile the
abstraction of the persistence implementation was broken.

Change-Id: I28e3ebf3a659a7cbc94be51bba9e1ad338f2b786
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoAvoid an NPE after 7b01a5369210 12/22712/1
Robin Rosenberg [Sat, 1 Mar 2014 11:44:34 +0000 (12:44 +0100)]
Avoid an NPE after 7b01a5369210

While fixing an NPE, I introduced another one in a deprecated isModified
method. It cannot avoid NPE's entirely, which is the reason the method
is deprecated

Change-Id: I5147c1c94621586dd84bd11e6090a954523b6c1c

10 years agoAdd a launcher for Java 7 tests 54/22654/2
Robin Rosenberg [Fri, 28 Feb 2014 06:19:29 +0000 (07:19 +0100)]
Add a launcher for Java 7 tests

Just like we have launcher for other packages

Change-Id: I140b88b8fdcab08d6515cd1f0ba9a53a9701f60d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoRemove obsolete getRepositoryMethod from WorkingTreeIterator 53/22653/2
Robin Rosenberg [Fri, 28 Feb 2014 06:16:42 +0000 (07:16 +0100)]
Remove obsolete getRepositoryMethod from WorkingTreeIterator

The method was added for symlink support, but isn't needed anymore.
Since it was added for this release it's like it never existed.

Change-Id: I422cd1dcdfa40b25ba3d6e08b112159dae9a4353
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoFix NPE when WorkingTreeIterator does not have a repository set 52/22652/2
Robin Rosenberg [Fri, 28 Feb 2014 06:15:08 +0000 (07:15 +0100)]
Fix NPE when WorkingTreeIterator does not have a repository set

It's strange that we have that member since it is not so clear
when it it set or not.

Change-Id: I53903a264f46866d249901a3cd9f9295028aa6bd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge "Don't raise checkout conflict for file missing in working tree"
Christian Halstrick [Thu, 27 Feb 2014 21:17:56 +0000 (16:17 -0500)]
Merge "Don't raise checkout conflict for file missing in working tree"

10 years agoCLI clone command should support --no-checkout 41/22441/2
Kaloyan Raev [Mon, 24 Feb 2014 14:03:51 +0000 (16:03 +0200)]
CLI clone command should support --no-checkout

doCheckout() is called only if --no-checkout option is not set.

Bug: 428917
Change-Id: I350bef446dd7a37613b9506aae99679569bd36e1
Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoDon't raise checkout conflict for file missing in working tree 29/22529/2
Christian Halstrick [Tue, 25 Feb 2014 16:29:45 +0000 (17:29 +0100)]
Don't raise checkout conflict for file missing in working tree

During a checkout we want to prevent to overwrite unsaved local file
content. Jgit was therefore checking whether the file to overwrite is
dirty or missing and would raise a conflict if this was the case. That
was wrong. It should only check if the file is dirty. It's ok to
"overwrite" a missing/non-existing file.

Change-Id: I63c3a94f663c87f09170fdf8b1b1bf4ed5246fc5
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
10 years agoMerge "Add a missing @since tag"
Matthias Sohn [Wed, 26 Feb 2014 13:50:42 +0000 (08:50 -0500)]
Merge "Add a missing @since tag"

10 years agoMerge "Files should be deleted with "retry" option"
Matthias Sohn [Wed, 26 Feb 2014 13:49:17 +0000 (08:49 -0500)]
Merge "Files should be deleted with "retry" option"

10 years agoAdd a missing @since tag 64/22564/1
Christian Halstrick [Wed, 26 Feb 2014 13:29:51 +0000 (14:29 +0100)]
Add a missing @since tag

Change-Id: Ie34a4a9c4c47c2f27579094d74a7849fc26a323b

10 years agoFiles should be deleted with "retry" option 61/22461/3
Marc Strapetz [Mon, 24 Feb 2014 17:38:20 +0000 (18:38 +0100)]
Files should be deleted with "retry" option

Some of our Windows users have reported sporadic file system access
problems related to ObjectDirectory(Inserter) file deletion code in
combination with antiviral/firewall tools. For one of these users the
problem was fairly reproducible and changing deletion to RETRY solved
his problem.

Change-Id: I1e4001d5557fca693b7bac401268599467cb0c9e
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>‌
10 years agoDirCacheEntry: access to raw path 56/22456/3
Marc Strapetz [Mon, 27 May 2013 08:32:47 +0000 (10:32 +0200)]
DirCacheEntry: access to raw path

Change-Id: I5d1f6c4b5b3d7a971367cdd0cc9fa4022dff5b85
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>‌
10 years agoAdd getPackFile to ReceivePack to make PostReceiveHook more usable 46/22446/4
Saša Živkov [Mon, 24 Feb 2014 16:03:40 +0000 (17:03 +0100)]
Add getPackFile to ReceivePack to make PostReceiveHook more usable

Having access to the pack file that was created by the ReceivePack
may be useful for post receive hooks. For example, a hook may want
to check the size of the received pack and the created index.

Change-Id: I4d51758e4565d32c9f8892242947eb72644b847d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoPossibility to limit the max pack size on receive-pack 05/22505/1
Saša Živkov [Thu, 30 Jan 2014 14:04:43 +0000 (15:04 +0100)]
Possibility to limit the max pack size on receive-pack

The maxPackSizeLimit, when set, will reject a pack if it exceeds
that limit.

This feature is intended to provide a mechanism to control disk space
quota on Git repositories.

Change-Id: I83d8db670875c395f8171461b402083323e623a5
CQ: 7896

10 years agoFix possible NPE in Repository.resolve 62/22462/1
Marc Strapetz [Thu, 16 Jan 2014 15:55:50 +0000 (16:55 +0100)]
Fix possible NPE in Repository.resolve

Change-Id: I9b19cd90b338a4c3cae5661c658526b7e98c95d1
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>‌
10 years agoDirCache.findEntry(byte[], in) made public 58/22458/1
Marc Strapetz [Mon, 27 May 2013 08:32:47 +0000 (10:32 +0200)]
DirCache.findEntry(byte[], in) made public

Change-Id: Ice64e3b0e5d67a39690aa24e41c954b8ce312d49
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>‌
10 years agoPackage httpclient and httpcore in o.e.j.http.apache.feature 08/22408/1
Matthias Sohn [Mon, 24 Feb 2014 00:19:00 +0000 (01:19 +0100)]
Package httpclient and httpcore in o.e.j.http.apache.feature

When adding the new feature o.e.j.http.apache.feature in
I4adfecd56d84ee24a50cadb1700c8be56e4172a3 in order to make the
httpclient based implementation optional I missed to also move the
apache libraries.

Change-Id: I7285458a70aee3dd6faf739b68a0b5783b8da01d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge branch 'stable-3.3' 93/22393/1
Matthias Sohn [Fri, 21 Feb 2014 21:40:35 +0000 (22:40 +0100)]
Merge branch 'stable-3.3'

* stable-3.3:
  Move Apache httpclient based HTTP support to a separate bundle
  Prepare post 3.3.0RC1 builds
  JGit v3.3.0.201402191814-rc1
  [findBugs] Don't ignore exceptional return value of File.mkdir()
  [findBugs] Don't rely on default encoding
  [findBugs] Don't call toString() on a string

Change-Id: I50f91e1d3c1d29a44502f4bb9f0e6c05e21342b7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMove Apache httpclient based HTTP support to a separate bundle 38/22338/3
Matthias Sohn [Thu, 20 Feb 2014 21:07:48 +0000 (22:07 +0100)]
Move Apache httpclient based HTTP support to a separate bundle

This move avoids that all consumers of org.eclipse.jgit depend on Apache
httpclient. Also add another feature to make this optional for OSGi
consumers as well.

Change-Id: I5ef5e00c53678b9e1d7cfd54bbca3ff6f1c1c967
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoPrepare post 3.3.0RC1 builds 80/22280/1
Matthias Sohn [Thu, 20 Feb 2014 00:03:24 +0000 (01:03 +0100)]
Prepare post 3.3.0RC1 builds

Change-Id: I0d808f8733a490b75bbcaacedb4b095e05fab32e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoJGit v3.3.0.201402191814-rc1 77/22277/1 v3.3.0.201402191814-rc1
Matthias Sohn [Wed, 19 Feb 2014 23:14:45 +0000 (00:14 +0100)]
JGit v3.3.0.201402191814-rc1

Change-Id: Ida3a0417ae646ce37214153f49a85de2be3dd4fd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years ago[findBugs] Don't ignore exceptional return value of File.mkdir() 37/22137/2
Matthias Sohn [Tue, 18 Feb 2014 08:25:31 +0000 (09:25 +0100)]
[findBugs] Don't ignore exceptional return value of File.mkdir()

Change-Id: Ic4c61472412aa158a355bb444805cde8c5d2833a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years ago[findBugs] Don't rely on default encoding 36/22136/2
Matthias Sohn [Tue, 18 Feb 2014 08:24:30 +0000 (09:24 +0100)]
[findBugs] Don't rely on default encoding

Change-Id: I9be2ffe95e8d716326ba63b67672741ac316f9a5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years ago[findBugs] Don't call toString() on a string 35/22135/2
Matthias Sohn [Tue, 18 Feb 2014 08:23:13 +0000 (09:23 +0100)]
[findBugs] Don't call toString() on a string

Change-Id: I0b91ffd473e2f14623ddf409e4f0f342c8941e42
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoFix diff header on renamed or copied files 59/22059/4
Shawn Pearce [Fri, 14 Feb 2014 17:53:48 +0000 (09:53 -0800)]
Fix diff header on renamed or copied files

When git-core renames or copies a file and the mode differs the
header shows the mode change first, then the rename or copy data:

  diff --git a/COPYING b/LICENSE
  old mode 100644
  new mode 100755
  similarity index 92%
  rename from COPYING
  rename to LICENSE
  index d645695..54863be
  --- a/COPYING
  +++ b/LICENSE
  @@ -56,20 +56,6 @@

JGit relies on this ordering inside of FileHeader. Parsing "new file
mode NNN" after "copy from/to" or "rename from/to" resets the change
type to be ADD, losing the COPIED or RENAMED status and old path.

This fixes a 4 year old bug in Gerrit Code Review that prevents
opening a file for review if the file was copied from another file,
modified in this change, and the mode was updated (e.g. execute
bit was added).

Change-Id: If4c9ecd61ef0ca8e3e1ea857301f7b5c948efb96
[ms: added test case]
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>