]> source.dussan.org Git - jgit.git/log
jgit.git
10 years agoFix reading past FileTreeIterator EOF in FileTreeIteratorJava7Test 92/26992/1
Roberto Tyley [Wed, 21 May 2014 11:36:52 +0000 (12:36 +0100)]
Fix reading past FileTreeIterator EOF in FileTreeIteratorJava7Test

Stepping past the '.git' entry with `fti.next(1)` is unnecessary and in
fact a bug, as the subsequent access to FileTreeIterator is past it's
end-of-file - it has only 1 valid entry ('link').

This bug is only visibly exposed in certain environments depending on the
(unguaranteed) return order of `java.io.File.listFiles()`. On my box
FileTreeIteratorJava7Test would fail consistently for these 3 tests:

* testSymlinkActuallyModified
* testSymlinkNotModifiedThoughNormalized
* testSymlinkModifiedNotNormalized

They all failed in the same way:

testSymlinkActuallyModified(org.eclipse.jgit.treewalk.FileTreeIteratorJava7Test)  Time elapsed: 0.063 sec  <<< ERROR!
org.eclipse.jgit.api.errors.JGitInternalException: /home/roberto/development/jgit/org.eclipse.jgit.java7.test/target/jgit_test_9202429389985749040_tmp
/tmp_807992722429349842/.git (Is a directory)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:146)
        at org.eclipse.jgit.treewalk.FileTreeIterator$FileEntry.openInputStream(FileTreeIterator.java:210)
        at org.eclipse.jgit.treewalk.WorkingTreeIterator.readContentAsNormalizedString(WorkingTreeIterator.java:984)
        at org.eclipse.jgit.treewalk.WorkingTreeIterator.contentCheck(WorkingTreeIterator.java:924)
        at org.eclipse.jgit.treewalk.WorkingTreeIterator.isModified(WorkingTreeIterator.java:860)
        at org.eclipse.jgit.treewalk.WorkingTreeIterator.isModified(WorkingTreeIterator.java:815)
        at org.eclipse.jgit.treewalk.FileTreeIteratorJava7Test.testSymlinkActuallyModified(FileTreeIteratorJava7Test.java:198)

Theses tests are all working with a small repo that has just two entries:
'.git' and 'link' (a symbolic link that's being tested on). `listFiles()`
is called by FileTreeIterator to get a preliminary list of FileEntry
objects:

https://github.com/eclipse/jgit/blob/6d724dcd/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java#L139

Whether your tests appeared to pass or fail was dependent on the returned
order of files from `listFiles()`:

* ['.git', 'link'] - PASS (Eclipse Hudson appears to get this ordering)
* ['link', '.git'] - FAIL (My env, Ubuntu 14.04/Java 1.7.0_55)

The tree-iterator passes the resulting `FileEntry`s to it's init() method:

https://github.com/eclipse/jgit/blob/6d724dcd/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java#L639-L665

... where a count of valid entries is made (`entryCnt`), the 'invalid'
entries (like'.git') being left in the hinterland of the `entries` array.
The rearrangement in the entries array for our tests looks like this:

* ['.git', 'link'] -> ['link', 'link']
* ['link', '.git'] -> ['link', '.git']

In both cases, `entryCnt` is set to 1, meaning that the _valid_ portion of
the iterator is the same (ie ['link']), but that the portion after EOF,
which we reach by calling `fti.next(1)`, is _different_ depending on your
environment. The entry used by the iterator at that point will be either
'link' (if you're lucky) or '.git', which will blow up the test.

Note that somewhat ironically, the 'self-check' assertions don't catch
this bug, as 'path' data is only parsed _before_ EOF - so
`fti.getEntryPathString()` returns the string "link" (and the assertion
passes) regardless of whether you're about to read the '.git' entry or not.

Change-Id: Ie58a7bc76b740ee52881ebf555564a74379028d6
Signed-off-by: Roberto Tyley <roberto.tyley@gmail.com>
10 years agoblame: Revert common subtree elimination "optimization" 12/25612/3
Shawn Pearce [Sat, 26 Apr 2014 17:40:30 +0000 (10:40 -0700)]
blame: Revert common subtree elimination "optimization"

This partially reverts 6de12836d72fe4cba9afc297c8988c6fff851fa9.

Performing a TreeWalk over 2 trees to identify and skip unmodified
subtrees to pass all blame onto an ancestor appears to be a micro
optimization that works for a very limited number of files.  In the
general case the 2 tree walk is slowing down blame more than it helps
to speed it up.

I keep coming up with files in multiple repositories where 6de128 is
making things worse, not better, and only one example where it
actually improved performance, render_view_impl.cc in chromium
as described in the commit message.

Change-Id: Ic6d5fff22acb5ab6485614a07bdb388e8c336679

10 years agoMerge "Cherry-Pick: Support --mainline to pick merges"
Robin Rosenberg [Mon, 19 May 2014 19:43:22 +0000 (15:43 -0400)]
Merge "Cherry-Pick: Support --mainline to pick merges"

10 years agoCherry-Pick: Support --mainline to pick merges 65/26765/3
Konrad Kügler [Fri, 16 May 2014 16:42:44 +0000 (18:42 +0200)]
Cherry-Pick: Support --mainline to pick merges

By specifying a mainline parent, a merge is cherry picked as if this
parent was its only parent. If no mainline parent is given, cherry
picking merges is not allowed, as before.

Change-Id: I391cb73bf8f49e2df61428c17b40fae8c86a8b76
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
10 years agoFix a number of failing conflict situations 60/22160/11
Robin Rosenberg [Sun, 30 Mar 2014 20:04:53 +0000 (22:04 +0200)]
Fix a number of failing conflict situations

Adds further tests where the working tree is dirty (differs from
index) and where we have staged but uncommitted changes.

Fixed the test case 9 for file/directory conflicts.

Bug: 428819
Change-Id: Ie44a288b052abe936ebb74272d0fefef3b218a7a
Signed-off-by: Axel Richard <axel.richard@obeo.fr>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
10 years agoMerge "Archive: Add the ability to select one or more paths."
Robin Rosenberg [Sat, 17 May 2014 17:00:26 +0000 (13:00 -0400)]
Merge "Archive: Add the ability to select one or more paths."

10 years agoFix failing ConfigTest on Windows 67/24167/5
Robin Rosenberg [Sun, 30 Mar 2014 14:09:20 +0000 (16:09 +0200)]
Fix failing ConfigTest on Windows

Trust the detection of features and just test CoreConfig.

Change-Id: I37f838d270a221a75d0d3842ba2f3f90aa1d6f01

10 years agoMerge "Command line: implement checkout -- <path>"
Matthias Sohn [Fri, 16 May 2014 20:50:41 +0000 (16:50 -0400)]
Merge "Command line: implement checkout -- <path>"

10 years agoRebase: Write an empty "quiet" file to make C Git happy 99/26699/1
Konrad Kügler [Fri, 16 May 2014 07:01:23 +0000 (09:01 +0200)]
Rebase: Write an empty "quiet" file to make C Git happy

C git tries to read this file from the rebase state directory and
complains about it not being there for rebases started by JGit. An empty
'quiet' file represents the (verbose) default.

Change-Id: I1844ccbf8d35442d7a8918b57b67eb9b9efd6352
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
10 years agoArchive: Add the ability to select one or more paths. 52/26152/8
Shaul Zorea [Wed, 7 May 2014 15:50:04 +0000 (18:50 +0300)]
Archive: Add the ability to select one or more paths.

Previously, it was only possible to archive the entire repository.
This patch introduces the ability to select specific files and
directories to archive.
Archiving the entire repository remains the default behaviour.

org.eclipse.jgit.api.ArchiveCommand: Adding setPaths(String... paths)
method.

Change-Id: Iedcd40fbfd71238b0088174bbe2717fae196e047
Signed-off-by: Shaul Zorea <shaulzorea@gmail.com>
10 years agoFix wrong Exception messages 22/26422/2
Christian Halstrick [Tue, 13 May 2014 07:17:25 +0000 (09:17 +0200)]
Fix wrong Exception messages

In two places we threw an IOException and the message was built using
JGitText.couldNotWriteFile. We specified 2 parameters, but this pattern
expects only one parameter. In both places we tried to rename a file,
that's why we wanted two parameters (src and target) for the exception
text.

I changed it to use JGitText.renameFileFailed which accepts two
parameters and fits better.

Change-Id: Ib8c2cf78f2b26ca2b97754fe91fdb20b30392415
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge "LsTree: quote paths in output"
Robin Rosenberg [Mon, 12 May 2014 21:35:45 +0000 (17:35 -0400)]
Merge "LsTree: quote paths in output"

10 years agoCommand line: implement checkout -- <path> 86/23086/3
Matthias Sohn [Mon, 10 Feb 2014 07:10:31 +0000 (08:10 +0100)]
Command line: implement checkout -- <path>

Change-Id: I3d261e6541fe0fcaa210587d2aa226e153071351
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoFix javadoc errors caused by missing tags for declared exceptions 41/26341/2
Tomasz Zarna [Sun, 11 May 2014 19:14:30 +0000 (21:14 +0200)]
Fix javadoc errors caused by missing tags for declared exceptions

Change-Id: I587aae0ad217ed092f061682ffa66c724f221096
Signed-off-by: Tomasz Zarna <tomasz.zarna@tasktop.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoHandle repo copyfile in bare repositories. 95/26195/5
Yuxuan 'fishy' Wang [Thu, 8 May 2014 00:14:01 +0000 (17:14 -0700)]
Handle repo copyfile in bare repositories.

Change-Id: Ie06f0c3d1bc9b2123102efaa5542ec3c232b72cd
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoHandle the revision attribute in repo manifest. 76/26076/6
Yuxuan 'fishy' Wang [Fri, 2 May 2014 18:15:34 +0000 (11:15 -0700)]
Handle the revision attribute in repo manifest.

Change-Id: I77fe073aeb13c58029551b7d6e1451a9b62dc766
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoLsTree: quote paths in output 69/26169/1
Dave Borowitz [Fri, 2 May 2014 22:48:59 +0000 (15:48 -0700)]
LsTree: quote paths in output

Change-Id: Ic78d5b41e057fcd3282e97ac73ed506666f28f88

10 years agoHandle repo submodules for bare repositories. 74/26074/3
Yuxuan 'fishy' Wang [Thu, 1 May 2014 18:50:00 +0000 (11:50 -0700)]
Handle repo submodules for bare repositories.

Change-Id: Id028a7bc9600baf0f3e2316a1f4b99e53ccc746a
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoFix manifests of source bundles 12/26112/1
Matthias Sohn [Wed, 7 May 2014 06:50:33 +0000 (08:50 +0200)]
Fix manifests of source bundles

- don't mark them as singleton to allow coexistence of multiple versions
  in the same installation
- add missing version qualifier to Eclipse-SourceBundle header

see
https://dev.eclipse.org/mhonarc/lists/cross-project-issues-dev/msg10524.html

Change-Id: Ie4e028038f5a1d3e18b0be06c3d2ea82e7f9068d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge changes I9ba0e70f,I1f38e055,Idb55a303
Dave Borowitz [Tue, 6 May 2014 18:05:14 +0000 (14:05 -0400)]
Merge changes I9ba0e70f,I1f38e055,Idb55a303

* changes:
  Do not rewrite parents in RevWalkTextBuiltins
  RevWalk: Allow disabling parent rewriting
  RevWalkTextBuiltin: Add -n to limit number of commits returned

10 years agoAllow callers to use different merging strategies 59/22559/4
Laurent Goubet [Tue, 21 Jan 2014 15:35:26 +0000 (16:35 +0100)]
Allow callers to use different merging strategies

Signed-off-by: Laurent Goubet <laurent.goubet@obeo.fr>
Change-Id: I84e9d7b4b772b4ad7d3e7010aad78291d4d178fe

10 years agoDo not rewrite parents in RevWalkTextBuiltins 00/26000/3
Dave Borowitz [Mon, 5 May 2014 22:21:16 +0000 (15:21 -0700)]
Do not rewrite parents in RevWalkTextBuiltins

Default behavior of C git is to skip parent rewriting unless
particular history simplification or --parents flags are passed. Since
JGit has no such flags, JGit should not rewrite parents.

Change-Id: I9ba0e70fe6d5f49f975b71eea46f93198900f37d

10 years agoRevWalk: Allow disabling parent rewriting 99/25999/3
Dave Borowitz [Mon, 5 May 2014 22:15:13 +0000 (15:15 -0700)]
RevWalk: Allow disabling parent rewriting

Previously, setting any TreeFilter on a RevWalk triggered parent
rewriting, which in the current StartGenerator implementation ends up
buffering the entire commit history in memory. Aside from causing poor
performance on large histories, this does not match the default
behavior of `git rev-list`, which does not rewrite parent SHAs unless
asked to via --parents/--children.

Add a new method setRewriteParents() to RevWalk to disable this
behavior. Continue rewriting parents by default to maintain backwards
compatibility.

Change-Id: I1f38e05526071c75ca58095e312663de5e6f334d

10 years agoRevWalkTextBuiltin: Add -n to limit number of commits returned 98/25998/2
Dave Borowitz [Mon, 5 May 2014 19:42:23 +0000 (12:42 -0700)]
RevWalkTextBuiltin: Add -n to limit number of commits returned

Implementing the -<#> flag from C git is less trivial.

Change-Id: Idb55a303304a6d4055aaf37d0b4dcf92c684e25f

10 years agoPrepare 3.4.0-SNAPSHOT builds 97/25997/1
Matthias Sohn [Mon, 5 May 2014 22:03:31 +0000 (00:03 +0200)]
Prepare 3.4.0-SNAPSHOT builds

Change-Id: I5cf20c875c3e92e12c2b22465774ba42513b9add
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoJGit v3.4.0.201405051725-m7 96/25996/1 v3.4.0.201405051725-m7
Matthias Sohn [Mon, 5 May 2014 21:33:03 +0000 (23:33 +0200)]
JGit v3.4.0.201405051725-m7

Change-Id: I8d941d22becdf019199a1c0fe28aa5835038647d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge "Make the resolve merger slightly more sub-classable."
Robin Rosenberg [Mon, 5 May 2014 19:09:03 +0000 (15:09 -0400)]
Merge "Make the resolve merger slightly more sub-classable."

10 years agoMerge "blame: Fix merges, where merge result differs only by whitespace"
Shawn Pearce [Sun, 4 May 2014 18:37:14 +0000 (14:37 -0400)]
Merge "blame: Fix merges, where merge result differs only by whitespace"

10 years agoUpdate 4.4 target to use Luna M7 orbit repository 20/25920/1
Matthias Sohn [Sat, 3 May 2014 23:51:38 +0000 (01:51 +0200)]
Update 4.4 target to use Luna M7 orbit repository

Change-Id: I9a19d5584deef970cc00a7b58beae84d55b20ddf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoAbstractPlotRenderer: Make private methods static where applicable 29/25629/2
Konrad Kügler [Sun, 27 Apr 2014 19:46:59 +0000 (21:46 +0200)]
AbstractPlotRenderer: Make private methods static where applicable

Change-Id: Iaf02502b02b2420c059f04bbe09254941301c727
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
10 years agoPlotLane: Use identity hashCode and equals 27/25627/3
Konrad Kügler [Sun, 27 Apr 2014 18:35:14 +0000 (20:35 +0200)]
PlotLane: Use identity hashCode and equals

Using the lane position and other data for equals/hashCode is not
useful.

Change-Id: I7af151d8a84544a77a486474c8ac71dd80090c66
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
10 years agoblame: Fix merges, where merge result differs only by whitespace 05/25905/3
Konrad Kügler [Sat, 3 May 2014 13:00:47 +0000 (15:00 +0200)]
blame: Fix merges, where merge result differs only by whitespace

When blaming a merge commit with "Ignore whitespace changes" enabled,
don't discard blame candidates for other parents when we encounter a
parent that only has whitespace changes compared to the merge result.

The algorithm early prepares parents for blaming, removing the
appropriate blame regions from the list of regions still to blame. Only
at the end, the prepared blame candidates are submitted for blaming.

When looking at a non-first parent which only differs in whitespace to
the merge result, it submitted that parent, but only to blame it for the
(usually few) lines not already prepared to blame on other parents. Due
to an early return the blame candidates for the previous parents were
forgotten, leaving many lines unannotated.

bug: 433024
Change-Id: I43c9caf2078b92b05e652dbed2192568907bf199
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
10 years agoFix push to repo with non-fetched refs 94/21094/6
Jean-Jacques Lafay [Fri, 25 Apr 2014 21:13:25 +0000 (16:13 -0500)]
Fix push to repo with non-fetched refs

When JGit uses bitmaps (which is the case after a gc), the push command
doesn't go through the code where MissingObjectExceptions are caught
for remote objects not found locally.

Fixed by removing earlier non-locally-found remote objects.

This was seen withing gerrit, see:
https://code.google.com/p/gerrit/issues/detail?id=2025

Bug: 426044
Change-Id: Ieda718a0530e3680036edfa0963ab88fdd1362c0
Signed-off-by: Jean-Jacques Lafay <jeanjacques.lafay@gmail.com>
Signed-off-by: Doug Kelly <dougk.ff7@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMake org.eclipse.jgit.packaging a general project 33/13833/3
Robin Rosenberg [Fri, 14 Jun 2013 22:57:50 +0000 (00:57 +0200)]
Make org.eclipse.jgit.packaging a general project

This makes it easy to edit the pom.xml from within Eclipse.

Change-Id: I4718217caadbfe892b7cbb557e0d3d6b40d48321
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge changes I2515a6ed,Ib6b24035
Matthias Sohn [Sun, 27 Apr 2014 13:34:02 +0000 (09:34 -0400)]
Merge changes I2515a6ed,Ib6b24035

* changes:
  Fix ArrayIndexOutOfBoundsException in CreateBranchCommand
  Add methods to Repository to handle remote names

10 years agoFix ArrayIndexOutOfBoundsException in CreateBranchCommand 04/25604/4
Robin Rosenberg [Sat, 26 Apr 2014 11:05:53 +0000 (13:05 +0200)]
Fix ArrayIndexOutOfBoundsException in CreateBranchCommand

If remote name contains / or there was a branch directly under the
refs/remotes namespace (wrong) the computation of remote name and
suggested local branch name would fail. Fix this by looking at the
configured remotes. A ref under refs/remotes that does not match a
remote configuration is not considered a remote tracking branch anymore.

This patch does not fix all similar errors in EGit/JGit.

Bug: 411002
Bug: 400414
Change-Id: I2515a6ed05f9104c387ce4e43b24dae942ae2473

10 years agoAdd methods to Repository to handle remote names 03/25603/3
Robin Rosenberg [Sat, 26 Apr 2014 08:55:42 +0000 (10:55 +0200)]
Add methods to Repository to handle remote names

Instead of requiring the caller to know how to list remote
names or parse remote branch names, add a few utilities for
that.

Change-Id: Ib6b2403532f4abbce594a03c0b9da49d30b19f70
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
10 years agoFix BlameResult.computeRange JavaDoc to exclude end index 06/25606/1
Konrad Kügler [Sat, 26 Apr 2014 12:29:55 +0000 (14:29 +0200)]
Fix BlameResult.computeRange JavaDoc to exclude end index

Change-Id: Ifd7dd86e3848eb7a522ba5c49d5c216777484f3b
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
10 years agoAdd API to permit the setting of additional HTTP headers 09/23409/5
Bogdan Gheorghe [Fri, 14 Mar 2014 20:00:25 +0000 (16:00 -0400)]
Add API to permit the setting of additional HTTP headers

Signed-off-by: Bogdan Gheorghe <gheorghe@ca.ibm.com>
Change-Id: I1047f318bb5c63850f45ba85d73c97fe8bf70a6c

10 years agocleanup: remove some unused imports 92/25592/2
Robin Rosenberg [Fri, 25 Apr 2014 20:27:35 +0000 (22:27 +0200)]
cleanup: remove some unused imports

Change-Id: I549b934b86753acc362364c8986bfe6457affd12

10 years agoMaking ArchiveFormats breaks the API, but that's ok 91/25591/2
Robin Rosenberg [Fri, 25 Apr 2014 20:27:16 +0000 (22:27 +0200)]
Making ArchiveFormats breaks the API, but that's ok

Add compatibility filters to hide the breakage.

Change-Id: Icc1fdc29f15d734d488e49c9c37a18f5ac937903

10 years agoAdd jacoco instrumentation for code coverage reports 10/10610/9
Matthias Sohn [Mon, 25 Feb 2013 00:10:40 +0000 (01:10 +0100)]
Add jacoco instrumentation for code coverage reports

See http://mickaelistria.wordpress.com/2012/10/08/sonar-at-eclipse-org/

Change-Id: Idd7df8125e0792e9bba924eadbc1320230cfa624
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge changes Ia4df9808,I83e8a321,Id0e7663b,Ib809b00c,I88a6ee07
Shawn Pearce [Fri, 25 Apr 2014 18:01:06 +0000 (14:01 -0400)]
Merge changes Ia4df9808,I83e8a321,Id0e7663b,Ib809b00c,I88a6ee07

* changes:
  Commit changes generated during repo command
  Added implementation of copyfile rule.
  Added groups support to repo subcommand.
  Added the command line of jgit repo.
  Implemented first part of the repo sub-command.

10 years agoCommit changes generated during repo command 85/25285/5
Yuxuan 'fishy' Wang [Fri, 18 Apr 2014 15:23:20 +0000 (08:23 -0700)]
Commit changes generated during repo command

Change-Id: Ia4df9808294d2069dcc5973bcb69b4499c7dcacd
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoMerge "Automatically reload known_hosts file"
Shawn Pearce [Fri, 25 Apr 2014 16:34:37 +0000 (12:34 -0400)]
Merge "Automatically reload known_hosts file"

10 years agoAutomatically reload known_hosts file 23/25523/2
Doug Kelly [Thu, 24 Apr 2014 19:37:27 +0000 (14:37 -0500)]
Automatically reload known_hosts file

JGit caches the contents of the known_hosts file within JSch when
first started, and never attempts to re-read it.  If the contents
change (such as when using Gerrit replication), the new host will
never be found.

On failures, try reloading the knonwn_hosts and retry the
connection, in addition to reloading the credentials.

Change-Id: I980c4f4003f2a48c71b9b47c51e640d1e7742f58
Signed-off-by: Doug Kelly <dougk.ff7@gmail.com>
10 years agoRemove streaming delta support from JGit 49/25449/4
Doug Kelly [Thu, 24 Apr 2014 00:33:18 +0000 (19:33 -0500)]
Remove streaming delta support from JGit

Streaming packed deltas is so slow that it never feasibly completes
(it will take hours for it to stream a few hundred megabytes on
relatively fast systems with a large amount of storage).  This
was indicated as a "failed experiment" by Shawn in the following
mailing list post:
http://dev.eclipse.org/mhonarc/lists/jgit-dev/msg01674.html

Change-Id: Idc12f59e37b122f13856d7b533a5af9d8867a8a5
Signed-off-by: Doug Kelly <dougk.ff7@gmail.com>
10 years agoAdded implementation of copyfile rule. 81/24681/8
Yuxuan 'fishy' Wang [Tue, 25 Mar 2014 22:30:54 +0000 (15:30 -0700)]
Added implementation of copyfile rule.

Change-Id: I83e8a3218be2984321342039fda507fdb1aa5f30
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoAdded groups support to repo subcommand. 80/24680/6
Yuxuan 'fishy' Wang [Mon, 24 Mar 2014 19:40:04 +0000 (12:40 -0700)]
Added groups support to repo subcommand.

Change-Id: Id0e7663b6ac4f6938fdcacaf2158107b6285fc25
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoAdded the command line of jgit repo. 79/24679/6
Yuxuan 'fishy' Wang [Mon, 24 Mar 2014 19:39:41 +0000 (12:39 -0700)]
Added the command line of jgit repo.

Change-Id: Ib809b00c236a9c44422a872ae801b060f5b26808
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoImplemented first part of the repo sub-command. 78/24678/6
Yuxuan 'fishy' Wang [Mon, 24 Mar 2014 19:39:09 +0000 (12:39 -0700)]
Implemented first part of the repo sub-command.

Currently the repo sub-command only "works", but the submodules will have .git
directories themselves, and lacks group support.

Change-Id: I88a6ee07109187c6c9bfd92a044775fcfb5befa6
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoMerge "blame: Format commit and author only once per range"
Shawn Pearce [Wed, 23 Apr 2014 20:33:16 +0000 (16:33 -0400)]
Merge "blame: Format commit and author only once per range"

10 years agoMerge changes Icb1d49e5,I8bcab447,I3fa19b86,I2cda031b,I8b2dbf63
Shawn Pearce [Tue, 22 Apr 2014 19:59:07 +0000 (15:59 -0400)]
Merge changes Icb1d49e5,I8bcab447,I3fa19b86,I2cda031b,I8b2dbf63

* changes:
  blame: Reuse existing blameEntireRegionOnParent method
  blame: Remove unnecessary curly braces around single statement if
  blame: Allow candidate to manage its setup before output
  blame: Do not update candidate regionList during output
  blame: Only use computeRange if -L was requested

10 years agoblame: Format commit and author only once per range 09/25309/2
Shawn Pearce [Sun, 20 Apr 2014 01:34:21 +0000 (18:34 -0700)]
blame: Format commit and author only once per range

When a commit is blamed for multiple lines of the result file the
command line interface prints the same text before each line in that
span.  Format these strings once and reuse them as the line prefix.

For long files (e.g. 2425 lines of ReceiveCommits.java in Gerrit)
this can save as much as 20ms during the output phase of the command
line blame program.

Change-Id: Ie42787d77c8d0cbca7ccbf59c795120494a2a891

10 years agoblame: Reuse existing blameEntireRegionOnParent method 14/25314/2
Shawn Pearce [Sun, 20 Apr 2014 22:55:32 +0000 (15:55 -0700)]
blame: Reuse existing blameEntireRegionOnParent method

Skipping directly to the parent is already possible with an existing
helper method. Update the source path (to follow the rename) and then
use the existing code path to push the parent inside the current entry.

Change-Id: Icb1d49e53d14b599efc478990613625a9e058e09

10 years agoblame: Remove unnecessary curly braces around single statement if 13/25313/2
Shawn Pearce [Sun, 20 Apr 2014 22:54:10 +0000 (15:54 -0700)]
blame: Remove unnecessary curly braces around single statement if

Change-Id: I8bcab44785fe08bbf3519c634e57ebfea8d3f0f9

10 years agoblame: Allow candidate to manage its setup before output 11/25311/2
Shawn Pearce [Sun, 20 Apr 2014 03:02:19 +0000 (20:02 -0700)]
blame: Allow candidate to manage its setup before output

Pass in the RevWalk and let the candidate decide how to prepare itself
for output. This removes the conditional for the missing sourceCommit,
as candidates missing a commit can override the method with a no-op.

Change-Id: I3fa19b8676dfd3c177583f8f42593b5000b5350d

10 years agoblame: Do not update candidate regionList during output 10/25310/2
Shawn Pearce [Sun, 20 Apr 2014 02:59:21 +0000 (19:59 -0700)]
blame: Do not update candidate regionList during output

Instead of updating the candidate's regionList field to iterate
through the linked list of regions, use a special purpose field
in the BlameGenerator. This allows the candidate to be unmodified.

Change-Id: I2cda031b59220ab603ef82050e741ecbbaa1953f

10 years agoblame: Only use computeRange if -L was requested 08/25308/2
Shawn Pearce [Sun, 20 Apr 2014 01:24:43 +0000 (18:24 -0700)]
blame: Only use computeRange if -L was requested

The computeRange method is inefficient for computing the entire file.
If the entire file was selected ask for the entire file.

Change-Id: I8b2dbf635e875cc125443dac50be121208646540

10 years agopgm: Flush stderr during shutdown 07/25307/2
Shawn Pearce [Sun, 20 Apr 2014 01:02:48 +0000 (18:02 -0700)]
pgm: Flush stderr during shutdown

If an error occurs in command line option parsing the error message
may be stuck in a Java level buffer.  Flush the stream to ensure
everything is made available to the calling process or terminal.

Change-Id: I55b16e43aa96fc81c1197121032f5cdd901d412c

10 years agoExpose ReceiveCommand version of TrackingRefUpdate 93/25293/1
Shawn Pearce [Fri, 18 Apr 2014 21:03:20 +0000 (14:03 -0700)]
Expose ReceiveCommand version of TrackingRefUpdate

If the caller uses a BatchRefUpdate to execute these (e.g. fetch)
there may be more detailed status information inside of the command
that was used to execute it. Allow the caller to obtain that status
data from the ReceiveCommand version of the TrackingRefUpdate.

Change-Id: I47209377fb8fcef0346d7678f1ab27f4790b49bc

10 years agoMerge changes I483c40e8,Ib16d684d,I9fb25229,I5f7c4855,I36905959
Shawn Pearce [Fri, 18 Apr 2014 19:23:07 +0000 (15:23 -0400)]
Merge changes I483c40e8,Ib16d684d,I9fb25229,I5f7c4855,I36905959

* changes:
  diff: Optimize single line edits
  blame: Reduce running time ~4.5% by skipping common subtrees
  blame: Micro optimize blob lookup in tree
  blame: Automatically increase commit abbreviation length
  Blame correctly in the presence of conflicting merges

10 years agodiff: Optimize single line edits 86/25286/4
Shawn Pearce [Fri, 18 Apr 2014 16:05:05 +0000 (09:05 -0700)]
diff: Optimize single line edits

If the header and trailer are identical up to a single line on both
sides, return that REPLACE edit as the only result.  No algorithm can
break down a REPLACE with height of 1.

Change-Id: I483c40e8790cc3e8b322ef6dfce2299491fd0ac7

10 years agoMerge branch 'stable-3.3' 69/25269/1
Matthias Sohn [Fri, 18 Apr 2014 12:53:40 +0000 (14:53 +0200)]
Merge branch 'stable-3.3'

* stable-3.3:
  JGit v3.3.2.201404171909-r
  Fix version.sh to update Eclipse-SourceBundle version

Change-Id: Ic4f5d5c73f18775ca4449bb79d46e3b807a46ab2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoJGit v3.3.2.201404171909-r 45/25245/2 stable-3.3 v3.3.2.201404171909-r
Matthias Sohn [Thu, 17 Apr 2014 23:44:26 +0000 (01:44 +0200)]
JGit v3.3.2.201404171909-r

Change-Id: I1d7e40156d0b6e30bd5f3a40f18c836b7d1ba78f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoFix version.sh to update Eclipse-SourceBundle version 46/25246/1
Matthias Sohn [Thu, 17 Apr 2014 23:11:49 +0000 (01:11 +0200)]
Fix version.sh to update Eclipse-SourceBundle version

The version attribute of Eclipse-SourceBundle must match
the bundle version.

Change-Id: Ic629ccae1d89c9070e4ec80420a0e2ed7d403922
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoblame: Reduce running time ~4.5% by skipping common subtrees 44/25244/2
Shawn Pearce [Thu, 17 Apr 2014 22:26:04 +0000 (15:26 -0700)]
blame: Reduce running time ~4.5% by skipping common subtrees

With this commit running blame on render_view_impl.cc[1] saves
about 644 ms over prior versions, reducing the time about 4.5%.

Large projects often contain strands of commits where no changes
are made to a particular subtree. Blame used to dive recursively
into these subtrees to look for the blob and check if its SHA-1
was changed. In chromium/src[1] only 20% of the commits modify
the content/renderer subtree relevant for the file.

The recursivePath is necessary to check for '/' and remember
if common subtree elimination should be attempted. When a file
lives within a subtree the extra cost to check for unmodified
subtrees saves time. However for files in the root tree the
extra work incurred by TreeWalk is not worthwhile and would
significantly increase overall running time.

Now typical running times from an otherwise idle desktop:

  real 0m13.387s  0m13.341s  0m13.443s
  user 0m15.410s  0m15.220s  0m15.350s

previously:

  real 0m14.085s  0m14.049s  0m13.968s
  user 0m15.730s  0m15.820s  0m15.770s

[1] https://chromium.googlesource.com/chromium/src/+show/34d6e5c5b4248b1b199405af7ad00f961921f347/content/renderer/render_view_impl.cc

Change-Id: Ib16d684df7ffa034ee28def3fb22c797998d5b7b

10 years agoblame: Micro optimize blob lookup in tree 43/25243/2
Shawn Pearce [Thu, 17 Apr 2014 22:03:18 +0000 (15:03 -0700)]
blame: Micro optimize blob lookup in tree

Avoid converting the raw mode to FileMode. This is an expensive
if-else-if sort of test to just check if the thing is a blob.
Instead test the bit mask directly, which is at least a few
instructions shorter.

The TreeWalk is already recursive and will auto-dive into any
subtrees found. isSubtree check is unnecessary, as is the loop,
as only one result will ever be returned by next().

Change-Id: I9fb25229ebed857469427bfbdf74aedebfddfac8

10 years agoblame: Automatically increase commit abbreviation length 39/25239/3
Shawn Pearce [Thu, 17 Apr 2014 21:19:23 +0000 (14:19 -0700)]
blame: Automatically increase commit abbreviation length

Ensure commit object names are unique by extending the default
abbreviation as long as necessary. This allows `jgit blame` to
more closely match the formatted output of `git blame` on large
histories like Gerrit Code Review's ReceiveCommits.java file.

Change-Id: I5f7c4855769ee9dcba973389df9e109005dcdb5b

10 years agoBlame correctly in the presence of conflicting merges 16/24916/6
Konrad Kügler [Sun, 13 Apr 2014 17:21:06 +0000 (19:21 +0200)]
Blame correctly in the presence of conflicting merges

Problem:
The BlameGenerator used the RevFlag SEEN to mark commits it had
already looked at (but not necessarily processed), to prevent
processing a commit multiple times. If a commit is a conflicting
merge that contains lines of the merge base, that have been deleted
in its first parent, either these lines or the lines untouched
since the merge base would not be blamed properly.

This happens for example if a file is modified on a main branch in an
earlier commit M and on a side branch in a later commit S. For this
example, M deletes some lines relative to the common base commit B,
and S modifies a subset of these lines, leaving some other of these
lines untouched.

Then side is merged into main, creating a conflict for these
lines. The merge resolution shall carry over some unmodified lines
from B that would otherwise be deleted by M. The route to blame
these lines is via S to B. They can't be blamed via M, as they
don't exist there anymore.

    Q
    |\
    | \
    | S
    | |
    M |
    | /
    |/
    B

Blaming the merged file first blames via S, because that is the
most recent commit. Doing so, it also looks at B to blame the
unmodified lines of B carried over by S into the merge result. In the
course of this, B is submitted for later processing and marked SEEN.

Later M is blamed. It notices that its parent commit B has been
SEEN and aborts processing for M. B is blamed after that, but only
for the lines that survived via S.

As a result, only the lines contributed by S or by B via S are
blamed. All the other lines that were unchanges by both M and S,
which should have been blamed to B via M, are not blamed.

Solution:
Don't abort processing when encountering a SEEN commit. Rather add the
new region list of lines to be blamed to those of the already SEEN and
enqueued commit's region list. This way when the B commit of the
above example is processed, it will blame both the lines of M and S,
yielding a complete blame result.

Bug: 374382
Change-Id: I369059597608022948009ea7708cc8190f05a8d3
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
Signed-off-by: Shawn Pearce <spearce@spearce.org>
10 years agoAllow ArchiveCommand.registerFormat to be called twice 87/24887/5
Jonathan Nieder [Wed, 16 Apr 2014 18:52:02 +0000 (11:52 -0700)]
Allow ArchiveCommand.registerFormat to be called twice

This should make it possible for the gitiles plugin to register its
archive formats after gerrit has already registered them.

Signed-off-by: Jonathan Nieder <jrn@google.com>
Change-Id: Icb80a446e583961a7278b707d572d6fe456c372c

10 years agoMerge "Make ArchiveFormats final and implement equals()"
Dave Borowitz [Mon, 14 Apr 2014 20:41:44 +0000 (16:41 -0400)]
Merge "Make ArchiveFormats final and implement equals()"

10 years agoMerge branch 'stable-3.3' 24/24924/1
Matthias Sohn [Sun, 13 Apr 2014 23:20:01 +0000 (01:20 +0200)]
Merge branch 'stable-3.3'

* stable-3.3:
  Ensure that stored credentials aren't reset too early

Change-Id: Idcd57e12f5fe905952be49edb4f82db6b7ed469f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
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 agoEnsure that stored credentials aren't reset too early 23/24923/1
Matthias Sohn [Wed, 26 Mar 2014 22:16:36 +0000 (23:16 +0100)]
Ensure that stored credentials aren't reset too early

Some commands are started without showing a dialog allowing to enter
credentials if needed. Hence we need to tolerate one failing HTTP
authentication to trigger loading credentials from the secure store.
Hence we should not immediately reset the stored credentials if the
first attempt to authenticate fails.

Bug: 431209
Change-Id: I1b9fa34c3d70be226bb1c59c9ebe995998d29bc8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMake ArchiveFormats final and implement equals() 86/24886/1
Jonathan Nieder [Fri, 11 Apr 2014 21:01:56 +0000 (14:01 -0700)]
Make ArchiveFormats final and implement equals()

This should make it easier to modify ArchiveCommand to allow an
archive format to be registered twice while still noticing if
different callers try to register different implementations for
the same format.

Change-Id: I32261bc8dc1877a853b49e0da0a6e78921791812
Signed-off-by: Jonathan Nieder <jrn@google.com>
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>