Commit Graph

4667 Commits

Author SHA1 Message Date
Dave Borowitz ba8eb93173 BatchRefUpdate: Include command message in toString()
Change-Id: I359f33af5aa84af77c3628e6cd9a5ee3f7f38d49
2016-06-02 13:24:59 -04:00
Shawn Pearce 4f0ebc4c3c Merge "DfsBlock: throw DataFormatException on 0 bytes" 2016-06-02 10:58:11 -04:00
Christian Halstrick efc1f7a112 Merge "Add missing @Test annotation in RepositoryCacheTest" 2016-06-02 03:30:03 -04:00
Christian Halstrick df75b9c0c1 Merge "Add missing @Test annotations" 2016-06-02 03:28:02 -04:00
Shawn Pearce 28b17afae5 DfsBlock: throw DataFormatException on 0 bytes
setInput should always push at least 1 byte into the Inflater.  If 0
bytes (or negative!) are being sent the DfsBlock is inconsistent with
the position passed in.  This indicates a severe programming problem
in the caller, and may cause an infinite loop in DfsReader.

Today we saw a handful of live examples of this but don't know what
the cause is.  Guard against this error condition and throw with a
more verbose failure, which may prevent an infinite loop.  Callers
will eventually catch DataFormatException and rethrow with more detail
about the object that cannot be inflated, with the DFE in the chain.

Change-Id: I64ed2a471520e48283675c6210c6db8a60634635
2016-06-01 21:48:21 -07:00
Matthias Sohn 34626614a8 Merge "Prepare 4.5.0-SNAPSHOT builds" 2016-06-01 18:13:35 -04:00
Dave Borowitz 0d6ba84065 DfsInserter: Optionally disable existing object check
When using a DfsInserter for high-throughput insertion of many
objects (analogous to git-fast-import), we don't necessarily want to
do a random object lookup for each. It'll be faster from the
inserter's perspective to insert the duplicate objects and let a later
GC handle the deduplication.

Change-Id: Ic97f5f01657b4525f157e6df66023f1f07fc1851
2016-06-01 17:21:33 -04:00
Matthias Sohn 75b3301939 Prepare 4.5.0-SNAPSHOT builds
Change-Id: I572fe9fea0e5ca0bec4648c916ae95a5b1ccf125
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-06-01 23:04:07 +02:00
Matthias Sohn 831c811f61 Prepare 4.4.0-SNAPSHOT builds
Change-Id: Ib41dfe4103f013ba87a1ce62ee24bc9e10300eff
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-06-01 22:36:51 +02:00
Hugo Arès f0a485d5a2 Add missing @Test annotations
Change-Id: Ie5ffcbf18233dc9b3eb232f714b5b58b6b93f4e0
Signed-off-by: Hugo Arès <hugo.ares@ericsson.com>
2016-06-01 16:06:23 -04:00
Hugo Arès 1c1885b81d Add missing @Test annotation in RepositoryCacheTest
Change-Id: I25a9b294084f7b9769efa67001a4973647da4079
Signed-off-by: Hugo Arès <hugo.ares@ericsson.com>
2016-06-01 15:59:07 -04:00
Matthias Sohn f3b8653021 JGit v4.4.0.201606011500-rc2
Change-Id: Ifd7b7baba7d676a630e2f742d369c4186ea450a6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-06-01 20:37:53 +02:00
Matthias Sohn dfb33e699c Merge branch 'master' into stable-4.4
* master:
  Fix javadoc errors and unused imports introduced by ddd0fe25
  RepoCommand: record manifest shallow recommendation in .gitmodules
  RepoCommand: record manifest groups as submodule labels
  Remove the deprecated TestRepository.getClock() method
  Replace use of deprecated method Repository.getRef()
  [findBugs] Prevent potential NPE in
    FileLfsRepository.getOutputStream()
  Better report on client side if push failed due to too large object
  [findBugs] Prevent potential NPE in CloneCommand.init()
  RepoCommand: remove --record-remote-branches
  RepoCommandTest: Improve assertion message for remote branch recording

Change-Id: I4fbce4f84925a933fcc9a48058ed6793f5821b97
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-06-01 16:10:11 +02:00
Matthias Sohn 525baa1213 Fix javadoc errors and unused imports introduced by ddd0fe25
Change-Id: I2d17115843e453c71febd4a58527effe658b48fd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-06-01 10:17:29 +02:00
Stefan Beller 6ae4ed0f7d RepoCommand: record manifest shallow recommendation in .gitmodules
Git core learned about the submodule.<name>.shallow option in
.gitmodules files, which is a recommendation to clone a submodule
shallow. A repo manifest may record a clone depth recommendation as
an optional field, which contains more information than a binary
shallow/nonshallow recommendation, so any attempted conversion may be
lossy. In practice the clone depth recommendation is either '1' or doesn't
exist, which is the binary behavior we have in Git core.

Change-Id: I51aa9cb6d1d9660dae6ab6d21ad7bae9bc5325e6
Signed-off-by: Stefan Beller <sbeller@google.com>
2016-05-31 15:19:52 -07:00
Stefan Beller ddd0fe257b RepoCommand: record manifest groups as submodule labels
Git core learned about attributes in pathspecs:

    pathspec: allow querying for attributes

    The pathspec mechanism is extended via the new
    ":(attr:eol=input)pattern/to/match" syntax to filter paths so that it
    requires paths to not just match the given pattern but also have the
    specified attrs attached for them to be chosen.

(177161a5f7, 2016-05-20)

We intend to use these pathspec attribute patterns for submodule
grouping, similar to the grouping in repo. So the RepoCommand which
translates repo manifest files into submodules should propagate this
information along. This requires writing information to the
.gitattributes file instead of the .gitmodules file. For now we just
overwrite any existing .gitattributes file and do not care about prior
attributes set. If this becomes an issue we need to figure out how to
correctly amend the grouping information to an existing .gitattributes
file.

Change-Id: I0f55b45786b6b8fc3d5be62d7f6aab9ac00ed60e
Signed-off-by: Stefan Beller <sbeller@google.com>
2016-05-31 15:18:20 -07:00
Terry Parker bd63a56da2 Remove the deprecated TestRepository.getClock() method
Gitles was the holdout and TestRepository.getClock() was removed via:
https://gerrit.googlesource.com/gitiles/+/f10481d8384d1695e6981b805c4e5e462e4b71ea

Change-Id: I90c0fc17be4891545b097a49763b0f0c202cc004
Signed-off-by: Terry Parker <tparker@google.com>
2016-05-31 10:16:53 -07:00
Matthias Sohn 4c236ff4bb Replace use of deprecated method Repository.getRef()
Change-Id: Iecf2b8deafc4991cc3333702fb9fa0638be7b914
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-31 00:11:11 +02:00
Matthias Sohn bfebe6ae4b [findBugs] Prevent potential NPE in FileLfsRepository.getOutputStream()
Change-Id: I6f91997e8a976e5f4ace91c082d8b9adf1451adc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-30 16:07:17 -04:00
Matthias Sohn 5b104a7275 Better report on client side if push failed due to too large object
JGits PushCommand and BasePackPushConnection were throwing a generic
exception when the pushed pack-file was rejected by the server since it
contained too large objects. Teach JGit to better analyze the server's
response to detect this situation and throw a more specific exception.

Detect this situation by parsing the status line sent by the server.
This change only recognizes the response sent by a JGit based server.
All other servers which report such problems in a different way still
lead to a generic TransportExceptions.

Also see https://git.eclipse.org/r/#/c/46348/

Change-Id: I8d6d65e4585ebb3846f7207e7d1a2f82fa9cbd86
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-30 15:53:55 -04:00
Matthias Sohn 6569a876a3 [findBugs] Prevent potential NPE in CloneCommand.init()
File.listFiles() returns null if the File is not a directory, improve
validation of directory and gitDir to fix this.

Change-Id: I763d08835faf96a0beb8e706992df0908526bd2c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-30 10:59:48 -04:00
Terry Parker 0269f07401 Merge "RepoCommandTest: Improve assertion message for remote branch recording" 2016-05-26 18:10:26 -04:00
Stefan Beller 063548b9af RepoCommand: remove --record-remote-branches
This function only works in bare mode, and the command line works in
non-bare mode, so there's no point in pretending to support it here.

Change-Id: Ia017aded93d072bdb9947ec08c424256c3abe438
Signed-off-by: Stefan Beller <sbeller@google.com>
2016-05-25 17:11:21 -07:00
Stefan Beller 53a64a0b8c RepoCommandTest: Improve assertion message for remote branch recording
Change-Id: Ic14e9f9c4bf007b464e463f5047ec5a8d0b9236c
Signed-off-by: Stefan Beller <sbeller@google.com>
2016-05-25 16:57:42 -07:00
Matthias Sohn 9720f9e249 Prepare 4.4.0-SNAPSHOT builds
Change-Id: Iba6e423294d3315465648d19087a674a73b5ef28
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-25 23:30:55 +02:00
Matthias Sohn f2c58503d7 JGit v4.4.0.201605250940-rc1
Change-Id: Idd8e1664730b979cfbd9a2196081a48a1efa3330
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-25 15:14:46 +02:00
Matthias Sohn eb84af7de2 Update Orbit repository for Neon to R20160520211859
Change-Id: I5e051a652848d8aae0d10c9e1bd42f6b320145f9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-25 15:03:04 +02:00
Matthias Sohn 88524581cf Merge branch 'master' into stable-4.4
* master:
  JGit CLI: allow to call git init with specific directory
  Redirect all Show output to outs
  Support git config [include] section with absolute path(s)
  Added filter for merge and non-merges commits.
  [findBugs] Prevent potential NPE in FS_POSIX.readUmask()
  [findBugs] Fix calculation of host header in SignerV4
  Update Orbit repository to S20160518051658 for Neon RC2
  Fix StashApply regarding handling of untracked files
  GC should not pack objects only referenced by ORIG_HEAD,...
  Make sure to overwrite files when "reset --hard" detects conflicts
  Allow setting FileMode to executable when applying patches in 
    ApplyCommand
  Fix config value get to return last instead of 1st just like git
  Remove UTF-8 checking duplication in Config lib subclasses
  Update Maven plugins
  Fix type parameter in javadoc in TestRepository.delete(String ref)
  TestRepository: Add delete() method
  Make BaseReceivePack.setAtomic public
  ReceivePack: Pass atomic setting from client to BatchRefUpdate

Change-Id: I5c9c5b7ccb23fb48b44b3da10b2c5d876d043d24
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-24 17:00:08 +02:00
Matthias Sohn fc0ec94bc3 Merge branch 'stable-4.3' into stable-4.4
* stable-4.3:
  Fix computation of id in WorkingTreeIterator with autocrlf and
    smudging
  Prepare 4.3.2-SNAPSHOT builds
  JGit v4.3.1.201605051710-r
  Scan loose ref before packed in case gc about to remove the loose
  Fix possible NPEs when reporting transport errors
  Fix calling of clean/smudge filters from Checkout,MergeCommands
  Fix ApplyCommand when result of patch is an empty file

Change-Id: I829f06699f6670e519d04c927bdba4b82df29199
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-24 16:44:03 +02:00
Christian Halstrick ffa237e7db Fix computation of id in WorkingTreeIterator with autocrlf and smudging
JGit failed to do checkouts when the index contained smudged entries and
autocrlf was on. In such cases the WorkingTreeIterator calculated the
SHA1 sometimes on content which was not correctly filtered. The SHA1 was
computed on content which two times went through a lf->crlf conversion.

We used to tell the treewalk whether it is a checkin or checkout
operation and always use the related filters when reading any content.
If on windows and autocrlf is true and we do a checkout operation then
we always used a lf->crlf conversion on any text content. That's not
correct. Even during a checkout we sometimes need the crlf->lf
conversion. E.g. when calculating the content-id for working-tree
content we need to use crlf->lf filtering although the overall operation
type is checkout.

Often this bug does not have effects because we seldom compute the
content-id of filesystem content during a checkout. But we do need to
know whether a file is dirty or not before we overwrite it during a
checkout. And if the index entries are smudged we don't trust the index
and compute filesystem-content-sha1's explicitly.

This caused EGit not to be able to switch branches anymore on Windows
when autocrlf was true. EGit denied the checkout because it thought
workingtree files are dirty because content-sha1 are computed on wrongly
filtered content.

Bug: 493360
Change-Id: I1072a57b4c529ba3aaa50b7b02d2b816bb64a9b8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-23 15:39:04 +02:00
Rüdiger Herrmann 8ff08994a4 JGit CLI: allow to call git init with specific directory
With this change it is possible to initialize repositories with
'git init /path/to/new/repo'

Change-Id: Ia9b288b4fb34887e8f5e2f3f270e521c44d41b6a
Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-22 22:11:03 +02:00
Rüdiger Herrmann b3f4abdda1 Redirect all Show output to outs
The Show command wrote all diffs to System.out instead of 'outs.

Bug: 494143
Change-Id: Ibc78e9a058b7a32d536e03e294c1d933b6c26ba7
Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-21 01:52:28 +02:00
Marco Miller 1f86350c5a Support git config [include] section with absolute path(s)
As per [1], but limited to absolute paths indeed. No support yet for
tilde or $HOME expansion. Support for the --[no-]includes options
([1]) is not part of this commit scope either, but those options'
defaults are in effect as described in [1].

[1] https://git-scm.com/docs/git-config

Included path can be a config file that includes other path-s in turn.
An exception is thrown if too many recursions (circular includes)
happen because of ill-specified config files.

Change-Id: I700bd7b7e1625eb7de0180f220c707d8e7b0930b
Signed-off-by: Marco Miller <marco.miller@ericsson.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-21 01:14:06 +02:00
Alcemir Santos ba0dfe1ae2 Added filter for merge and non-merges commits.
Added the option to retrieve either merge or non-merge commits in the
LogCommand.

Change-Id: Ie0e1c515a823f2392783f1a47d385c31230e8167
Signed-off-by: Alcemir Santos <alcemir.santos@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-20 01:05:40 +02:00
Matthias Sohn 3652887108 [findBugs] Prevent potential NPE in FS_POSIX.readUmask()
BufferedReader.readLine() returns null if the end of the stream has been
reached.

Change-Id: I83102bbfb1316407247e0f29023077af9e8d9606
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-19 15:04:46 +02:00
Matthias Sohn c54ff8bf12 [findBugs] Fix calculation of host header in SignerV4
We ignored the returned concatenation of host name and port number. Fix
this and use a StringBuilder to avoid creation of unnecessary String
objects.

Change-Id: I61fac639d4a4c95412eb41a0f9131d0c38aca794
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-19 15:01:05 +02:00
Matthias Sohn 4641c43a98 Prepare 4.3.2-SNAPSHOT builds
Change-Id: I71997a8be83841765111cb7b55506bd8edd8adad
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-19 10:17:39 +02:00
Matthias Sohn bf15a72ea0 Update Orbit repository to S20160518051658 for Neon RC2
Change-Id: If1bc2001108091770bccee7fa59b0e7f5e3974d7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-19 00:55:24 +02:00
Christian Halstrick ad1548b49e Fix StashApply regarding handling of untracked files
There was a bug regarding how JGit handled untracked files when applying
a stash. Problem was that untracked files are applied by doing a merge
of HEAD and untrackedFiles commit with a merge base of the stashed HEAD.
That's wrong because the untrackedFiles commit has no parent and
contains only the untracked files. Using stashed HEAD as merge base
leads to unneccessary conflicts on files not event included in the
untrackedFiles commit.

Imagine this graph directly before you want to apply a stash which was
based on 0. You want to apply the stash on current HEAD commit 5.

  5 (HEAD,master)
 /
0---+
 \   \
  1---3 (WIP on master)
     /
    2 (untracked files on master)

Imagine for a specific (tracked) file f
- commit 0 contains X
- HEAD contains Y
- commit 2 (the untracked files) does not contain file f

A merge of 2 and 5 with a merge base of 0 leads to a conflict. The 5
commit wants to modify the file and the 2 commit wants to delete the
file -> conflict.

If no merge base is set then the semantic is correct.

Thanks to Bow for finding this bug and providing the test case.

Bug: 485467
Change-Id: I453fa6ec337f81b2a52c4f51f23044faeec409e6
Also-by: Bow Ruggeri <bow@bow.net>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-19 00:04:32 +02:00
Christian Halstrick 6590c0a92a GC should not pack objects only referenced by ORIG_HEAD,...
There are references which are returned by
RefDatabase.getAdditionalRefs() which are allowed to point to
non-existing objects. These refs should not save objects from being
garbage collected. Examples for these references are ORIG_HEAD,
MERGE_HEAD, FETCH_HEAD and CHERRY_PICK_HEAD. Native git will not take
these references into account when doing a gc and therefore these
references may point to non-existing objects after a gc. Teach JGit's
GC to behave the same: ignore additional refs if they don't start with
"refs/". Examples for refs returned by getAdditionalRefs() which do
start with "refs/" are the bootstrap refs when using reftree's (see
commit 115f1ad3974d1162b33d1c8eff466019d1f249f3). See also
http://article.gmane.org/gmane.comp.version-control.git/294126.

Bug: 479697
Change-Id: I10e40589f13e72aacdd9f86f3b44696fd1cd068a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-18 22:49:22 +02:00
Christian Halstrick 0afd62efa8 Make sure to overwrite files when "reset --hard" detects conflicts
When performing a "reset --hard" a checkout is done. The pathes are
checked for potential checkout conflicts. But in the end for all
remaining conflicts these files are simply deleted from the working
tree. That's not the right strategy to handle checkout conflicts during
"reset --hard". Instead for every conflict we should simply checkout the
merge commit's content.

This is different from native gits behavior which reports errors when
during a "checkout --hard" a file shows up where a folder was expected.

  "warning: unable to unlink d/c.txt: Not a directory"

Why it is like that in native git was asked in
http://permalink.gmane.org/gmane.comp.version-control.git/279482. Unless
it is explained why native git why this error is reported JGit should
overwrite the files.

Bug: 474842
Change-Id: I08e23822a577aaf22120c5137eb169b6bd08447b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-18 13:29:02 +02:00
Nadav Cohen e81592e076 Allow setting FileMode to executable when applying patches in ApplyCommand
git-apply allows modifying file modes in patched files using either
"new mode" or "new file mode" headers. This patch adds support for
setting files as executables and vice-versa.

Change-Id: I24848966b46f686f540a8efa8150b42e0d9c3ad1
Signed-off-by: Nadav Cohen <nadavcoh@gmail.com>
2016-05-17 00:08:01 -07:00
Marco Miller 00db4ab06e Fix config value get to return last instead of 1st just like git
Before this fix, getting the value of 'key' below used to return
value1. This fix makes it so that value3 gets returned instead,
just like native git's get.

[section]
  key = value1
  key = value2
  key = value3

Change-Id: Iccb24de9b63c3ad8646c909494ca3f8c9ed6e29c
Signed-off-by: Marco Miller <marco.miller@ericsson.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-12 00:26:38 +02:00
Marco Miller e5a9915a92 Remove UTF-8 checking duplication in Config lib subclasses
Change-Id: Ib9f0ae8207000a36c5bf1a92fcc2c32efc4c0984
Signed-off-by: Marco Miller <marco.miller@ericsson.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-12 00:14:17 +02:00
Matthias Sohn 3bc46dfed5 Update Maven plugins
to the following versions:
build-helper-maven-plugin 1.10
eclipse-jarsigner-plugin 1.1.3
findbugs-maven-plugin 3.0.3
jacoco-maven-plugin 0.7.6.201602180812
maven-clean-plugin 3.0.0
maven-compiler-plugin 3.5.1
maven-javadoc-plugin 2.10.3
maven-pmd-plugin 3.6
maven-project-info-reports-plugin 2.9
maven-resources-plugin 2.7
maven-shade-plugin 2.4.3
maven-site-plugin 3.5.1
maven-source-plugin 3.0.0
maven-surefire-plugin 2.19.1
maven-surefire-report-plugin 2.19.1
tycho 0.25
tycho-extras 0.25
wagon-ssh 2.10

Change-Id: I4dc57de77ab7838964e8fe3de1d50f28d67fcf4b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-07 23:50:48 +02:00
Matthias Sohn 41b194c718 JGit v4.3.1.201605051710-r
Change-Id: I25fb72cc17d7a27b0b69746d907dac9ccd4d7997
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-05 23:08:18 +02:00
Matthias Sohn 0c72f60fbf Fix type parameter in javadoc in TestRepository.delete(String ref)
Type parameter T extends AnyObjectId in signature of update(String, T)

Change-Id: I9c13ddc572b8e94d5c7854f4de1f8206cb5e99ca
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-05 22:51:14 +02:00
Matthias Sohn 89db7e01fa Merge branch 'stable-4.3'
* stable-4.3:
  Scan loose ref before packed in case gc about to remove the loose
  Fix possible NPEs when reporting transport errors
  Fix calling of clean/smudge filters from Checkout,MergeCommands
  Fix ApplyCommand when result of patch is an empty file

Change-Id: I0dc76b7a8c87ce8e0386a1b9e0fa92a3aa62abf7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-05 01:13:45 +02:00
Marco Miller 05fd01656e Scan loose ref before packed in case gc about to remove the loose
Before this change, jgit used to read packed-refs before scanning
loose refs. That was not a problem if gc didn't run concurrently. When
gc did run concurrently with such refs reading, that order sometimes
broke the latter. This lead to reading an older version of a ref's
tip, which meant "losing" the real tip or commit. The specific
read-Vs-gc concurrency scenario which broke reading that way follows:

1. let ref R be in packed-refs and R' be in loose
2. jgit starts reading packed-refs
3. gc also starts its business around that very time
4. jgit still has the time to read R from packed-refs
5. as gc is not done yet updating packed-refs with R'
6. jgit then starts scanning loose refs (or is about to)
7. gc quickly ends up being done moving loose R' to packed-refs
8. so gc (quickly) removes loose refs
9. -while jgit is scanning loose refs, now gone
10. so jgit assumes no loose to consider => packed-refs winning
11. so jgit wrongfully returns R (from 4.) as the tip, instead of R'.

This fix switches the order so loose refs are scanned (secured) before
taking the time to read packed-refs. This way, knowledge of the
likelier tip is guaranteed for ref reading to return the true tip
- despite concurrent gc. If there is no loose ref to scan, jgit reads
packed-refs and lands on R' (or S), which it then returns, as
expected. The gerrit issue [1] should be solved by this fix.

[1] https://code.google.com/p/gerrit/issues/detail?id=2302

Change-Id: Ibd120120a361a3a6ed565f3836afc1db706fbcdd
Signed-off-by: Marco Miller <marco.miller@ericsson.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-05 00:49:44 +02:00
Jonathan Nieder bc9df9c63c TestRepository: Add delete() method
Change-Id: Ib4841397ceab44bd38cf2f154314ac36ded73ae0
2016-05-04 15:48:36 -07:00