Commit Graph

6208 Commits

Author SHA1 Message Date
Terry Parker 00e51e35ee Return parsed objects from TestRepository.commit/tree/blob()
It is convenient for TestRepository to return fully parsed
objects from its commit()/tree()/blob() methods, so that test
code doesn't have to remember to parse them before making
assertions about them.

Update TestRepostiory to return fully parsed objects.
Adjust the tests that are affected by this change in behavior.

Change-Id: I09d03d0c80ad22cb7092f4a2eaed99d40a10af63
Signed-off-by: Terry Parker <tparker@google.com>
2018-06-28 16:28:09 -07:00
David Pursehouse 28f7fac6c6 Update .mailmap
Change-Id: I9bd776e3d1ae120d56d6ee2f8eec9a5d80aa38cc
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-06-27 13:42:29 +09:00
Terry Parker 115a740e2f Correctly handle initialization of shallow commits
In a new RevWalk, if the first object parsed is one of the
shallow commits, the following happens:
1) RevCommit.parseCanonical() is called on a new "r1" RevCommit.
2) RevCommit.parseCanonical() immediately calls
   RevWalk.initializeShallowCommits().
3) RevWalk.initializeShallowCommits() calls lookupCommit(id),
   creating and adding a new "r2" version of this same object and
   marking its parents empty.
4) RevCommit.parseCanonical() initializes the "r1" RevCommit's
   fields, including the parents.
5) RevCommit.parseCanonical()'s caller uses the "r1" commit that
   has parents, losing the fact that it is a shallow commit.

This change passes the current RevCommit as an argument to
RevWalk.initializeShallowCommits() so that method can set its
parents empty rather than creating the duplicate "r2" commit.

Change-Id: I67b79aa2927dd71ac7b0d8f8917f423dcaf08c8a
Signed-off-by: Terry Parker <tparker@google.com>
2018-06-26 20:13:47 -07:00
Terry Parker e8e4fe7af6 Merge changes Ib6019b10,I82c71b52
* changes:
  Fix a GC scalability issue when selecting commit bitmaps
  Test uniform bitmap commit selection across multiple branches
2018-06-26 12:29:11 -04:00
tparker 2070d146cb Fix a GC scalability issue when selecting commit bitmaps
The previous algorithm selected commits by creating bitmaps at
each branch tip, doing a revwalk to populate each bitmap, and
looping in this way:
1) Select the remaining branch with the most commits (the branch
   whose bitmap has the highest cardinality)
2) Select well-spaced bitmaps in that branch
3) Remove commits in the selected branch from the remaining
   branch-tip bitmaps
4) Repeat at #1

This algorithm gave good commit selection on all branches but
a more uniform selection on "important" branches, where branch
length is the proxy for "important". However the algorithm
required N bitmaps of size M solely for the purpose of commit
selection, where N is the number of branch tips in the primary
GC pack, and M is the number of objects in the pack.

This new algorithm uses branch modification date as the proxy for
"important" branches, replacing the N*M memory allocation with a
single M-sized bitmap and N revwalks from new branch tips to
shared history (which will be short when there is a lot of shared
history).

GcCommitSelectionTest.testDistributionOnMultipleBranches verifies
that this algorithm still yields good coverage on all branches.

Change-Id: Ib6019b102b67eabb379e6b85623e4b5549590e6e
Signed-off-by: Terry Parker <tparker@google.com>
2018-06-26 09:23:46 -07:00
tparker 34fb1d7d21 Test uniform bitmap commit selection across multiple branches
Test that the commit selection algorithm provides appropriate
coverage across all branches.

Change-Id: I82c71b52068f01e8cef2398aecfec8e144d9a68b
Signed-off-by: Terry Parker <tparker@google.com>
2018-06-26 09:23:25 -07:00
Thomas Wolf f508a00176 CleanCommand: don't fire WorkingTreeModifiedEvent on dry run
Since no files are actually deleted it makes no sense to fire such an
event.

Change-Id: I66e87afc1791f27fddaa873bafe8bb8b61662535
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-06-26 08:26:38 +02:00
Matthias Sohn f40b39345c Merge branch 'stable-5.0'
* stable-5.0:
  Prepare 5.0.2-SNAPSHOT builds
  JGit v5.0.1.201806211838-r
  Add project-info reports to maven site
  Fix maven site generation failing with javadoc errors

Change-Id: Iedbc4c777a6e724f487419e187e25cf7e3aa55d6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-24 00:25:34 +02:00
David Pursehouse a7ea275eaf Merge branch 'stable-4.11' into stable-5.0
* stable-4.11:

Empty merge because of previous merge from stable-4.9 into
stable-5.0 and commits subsequently merged into stable-4.10
and stable-4.11.

Change-Id: I69b8d3e96173ef58b77186dfe462148075954ce4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-06-23 13:58:22 +09:00
David Pursehouse e4bb6441df Merge branch 'stable-4.10' into stable-4.11
* stable-4.10:
  Temporarily @Ignore flaky CommitCommandTest methods

Change-Id: I9902553ac442821416912d26a5d6ee1b0dc41cf4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-06-22 11:14:19 +09:00
Matthias Sohn ff15df05c3 Prepare 5.0.2-SNAPSHOT builds
Change-Id: I65e83f39a4082278c4cb809dbb08d44a119cebe0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-22 01:42:14 +02:00
Matthias Sohn a7e38fb0b0 JGit v5.0.1.201806211838-r
Change-Id: I594cd85d46698953c27da3687e4ec40aeb73b445
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-22 00:40:01 +02:00
Marco Miller 1dcb0688c7 ResolveMerger: Fix encoding with string; use bytes
This change fixes the issue [1]. Before this fix, a merge involving
the caching of consecutive yet similar filenames with Norwegian
characters [2] used to throw an IllegalStateException: Duplicate
stages not allowed. This was caused by inaccurate decoding of the
filenames, using string values assuming default encoding. In the
toString method of DirCacheEntry, used before through getPathString,
UTF-8 encoding is used, but the end result becomes default encoding,
through Object's default toString usage. The special characters in
those two consecutive (particular) filenames [2] were becoming the
very same decoded /single character, lending consecutive -but then
identical- filenames. Thus the perceived duplicate 0-staging of the
file(s).

Replace getPathString usage with getRawPath for this specific case,
or use byte array representations of cached entries instead of string.

Adding a test for this change is not possible, as there is no known
way to change the default encoding for filenames such as [2] (e.g.).
JGitTestUtil does write file contents through UTF-8, but encoding like
so does not apply to the actual file name. Hence there is no way to
create files with names properly made of special characters such as
[2]'s. And the test that is necessary for this case assumes such
Norwegian (or similar characters) filenames. Changing the default
locale programmatically in a test has no effect either. And changing
the LANG value passed to the JVM is only possible upon starting it.

[1] https://bugs.chromium.org/p/gerrit/issues/detail?id=9153

[2] <=>
(...)
"a/b/SíÒr-Norge.map",
"a/b/Sør-Norge.map",
(...)

Change-Id: Ib9f2f5297932337c9817064cc09d9f774dd168f4
Signed-off-by: Marco Miller <marco.miller@ericsson.com>
2018-06-21 15:38:56 -04:00
Matthias Sohn e36d5b40df Add project-info reports to maven site
Change-Id: I290d9c4a27d2ca1b9071f39639195e0d85799c00
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-21 11:21:44 +02:00
Matthias Sohn 12c4d77caa Fix maven site generation failing with javadoc errors
The same errors are suppressed when generating javadoc.
Suppress the errors during site generation.

Change-Id: I83bd1c10e5de82f47c351e7edf2c9230be4b1f21
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-21 10:48:48 +02:00
David Pursehouse 4770f076af Merge branch 'stable-4.9' into stable-4.10
* stable-4.9:
  Temporarily @Ignore flaky CommitCommandTest methods

Change-Id: I5f256aa6117847a25ab9e15c7d7ccc51e43cbb64
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-06-21 16:17:46 +09:00
Jonathan Nieder 82ae431e45 Merge branch 'stable-5.0'
* stable-5.0:
  Respect "unshallow" lines in protocol v2
  Temporarily @Ignore flaky CommitCommandTest methods

Change-Id: I14bd522d2f6bafb1b41e3c730d6dbef827e3e88a
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-06-20 21:24:05 -07:00
Jonathan Nieder 7df024b276 Respect "unshallow" lines in protocol v2
If I run

 git config --global protocol.version 2
 mkdir repo
 cd repo
 git init --bare
 git remote add origin https://go.googlesource.com/proposal
 git fetch --depth=1
 git fetch --unshallow

then I expect to have a full history, just as though I had fetched
without --depth in the first place.  Instead, it reports success
but does not fetch enough objects:

 $ git fsck
 notice: HEAD points to an unborn branch (master)
 Checking object directories: 100% (256/256), done.
 Checking objects: 100% (468/468), done.
 broken link from  commit 2c6bc83f234085c8eadb7ea33405ce6223c44d1b
               to  commit 878975cf2b600675b4c905e5d9591bd24541ae9e
 missing commit 878975cf2b600675b4c905e5d9591bd24541ae9e
 dangling commit 314be00dae78dd526851f5635e6349014e2ad0c2

The false success indicates problems in the client and the server.
Git 2.18-rc2 (the client) ought to have been more defensive, noticing
the incomplete history.  The greater error is in JGit (the server),
which neglects to send the objects requested.

When serving protocol v0 requests, JGit sends the correct objects by
taking unshallowCommits into account when generating the pack to send
to the client.  Do the same in the protocol v2 code path.  I forgot to
do this in v5.0.0.201806050710-rc3~6 (Teach UploadPack shallow fetch
in protocol v2, 2018-03-15).

Reported-by: Russ Cox <rsc@golang.org>
Change-Id: I282b45f47616a641b9e8d6210b4a070d3efdbb9b
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-06-20 21:20:41 -07:00
David Pursehouse 2149b085b1 Merge branch 'stable-4.9' into stable-5.0
* stable-4.9:
  Temporarily @Ignore flaky CommitCommandTest methods

Change-Id: I2db9bf014ba222d77851cc58da7ee5a0e8b344f6
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-06-20 16:09:19 +09:00
David Pursehouse 555790b59e Merge branch 'stable-4.8' into stable-4.9
* stable-4.8:
  Temporarily @Ignore flaky CommitCommandTest methods

Change-Id: I318813d19445ab7c44384015d36830ed02b8b590
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-06-20 16:08:36 +09:00
David Pursehouse f5b25bcad3 Merge branch 'stable-4.7' into stable-4.8
* stable-4.7:
  Temporarily @Ignore flaky CommitCommandTest methods

Change-Id: I016c9b3ec0081542bb903f361d9a3af1ea746ae3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-06-20 16:07:55 +09:00
David Pursehouse bb5dab9613 Merge branch 'stable-4.6' into stable-4.7
* stable-4.6:
  Temporarily @Ignore flaky CommitCommandTest methods

Change-Id: Idc653c22a9af2013a4c481bb19ca8d059f5c34d0
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-06-20 16:06:54 +09:00
David Pursehouse 0f7f3b62ce Merge branch 'stable-4.5' into stable-4.6
* stable-4.5:
  Temporarily @Ignore flaky CommitCommandTest methods

Change-Id: I2a0e0b63a06f442f5a088d4bc8bb08eaf02ce952
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-06-19 21:41:13 +09:00
Dave Borowitz 8223a7e646 Temporarily @Ignore flaky CommitCommandTest methods
Change-Id: Ia2c42d014323bd29b85bf76f1a20c83f612406d7
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
(cherry picked from commit e93b0026ce)
2018-06-19 20:52:23 +09:00
Thomas Wolf 2e76daec14 Avoid expensive getAllRefsByPeeledObjectId() in PlotWalk constructor
Instead, do it when we return the first PlotCommit from next().
On a repository with many refs, getAllRefsByPeeledObjectId() can
take a while. Doing a late initialization simplifies the handling
of a PlotWalk.

EGit, for instance, creates and configures an instance, and then
does the real walk in a background job. With late initialization,
the potentially expensive getAllRefsByPeeledObjectId() also occurs
in that background job.

Bug: 485743
Change-Id: I84c020cf8f7afda6f181778786612b8e6ddd7ed8
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-06-15 16:11:10 +02:00
Matthias Sohn b92136f023 Update Maven plugins
- build-helper-maven-plugin 3.0.0
- eclipse-jarsigner-plugin 1.1.5
- jacoco-maven-plugin 0.8.1
- maven-clean-plugin 3.1.0
- maven-jar-plugin 3.1.2
- maven-pmd-plugin 3.10.0
- maven-resources-plugin 3.1.0
- maven-shade-plugin 3.1.1
- maven-site-plugin 3.7.1
- maven-surefire-plugin 2.21.0
- maven-surefire-report-plugin 2.21.0
- plexus-compiler-javac 2.8.4
- spotbugs-maven-plugin 3.1.3.1
- tycho 1.2.0 (leftover)
- wagon-ssh 3.1.0

Change-Id: I8eba2ee448437a775542ef6a7c59661727aa207c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-14 11:29:26 +02:00
Michael Keppler 54e895b87c Upgrade Tycho to 1.2.0
Change-Id: I2f1c81839d2d78ddfd10b3992d1145546d10fa8c
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-14 08:49:14 +02:00
Matthias Sohn 331f1a8e49 Merge branch 'stable-5.0'
* stable-5.0:
  Prepare 5.0.1-SNAPSHOT builds
  JGit v5.0.0.201806131550-r
  JGit v5.0.0.201806131210-r
  Downgrade Apache httpclient to 4.5.2.v20170210-0925
  RefUpdateTest: Refactor to not use deprecated Repository#getAllRefs
  Propagate failure of ssh command to caller of SshSupport
  Make JGit describe behaves same as c-git for lightweight tags
  Fix issues with LFS on GitHub (SSH)

Change-Id: I0471440919adfdbfc72996711d9e0bbd1f3cf477
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-14 00:00:30 +02:00
Matthias Sohn 0dbaf9d951 Prepare 5.0.1-SNAPSHOT builds
Change-Id: Iadf12dbdd63ef17c3f712c0fc18495304aa35016
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-13 23:24:42 +02:00
Matthias Sohn e729a83bd2 JGit v5.0.0.201806131550-r
Change-Id: Ia2d548676217250593c3f0c383aec19e12e5e4a4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-13 21:42:40 +02:00
Matthias Sohn 94a585e6e8 JGit v5.0.0.201806131210-r
Change-Id: Iedccfcaf57c11822f1faf5d5195357de42b2a14e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-13 18:11:23 +02:00
Matthias Sohn 2d276161a2 Downgrade Apache httpclient to 4.5.2.v20170210-0925
Eclipse platform uses this version from the Oxygen Orbit release for
Photon. In order to avoid that we end up with two slightly different
versions in the same p2 repository of the simultaneous release we
downgrade temporarily from the version 4.5.2.v20180410-1551 in the
Photon Orbit release.

See
https://dev.eclipse.org/mhonarc/lists/cross-project-issues-dev/msg15659.html

Change-Id: Id46a840aa4b1010af7fe311498f17f1f2e5b81e0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-13 13:18:12 +02:00
David Pursehouse 5ff56d2ed1 RefUpdateTest: Refactor to not use deprecated Repository#getAllRefs
Change-Id: I157e62a0e1479d4bc95ef867e616ca8a30041759
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-06-13 11:24:46 +02:00
Matthias Sohn f7fbc7fcd7 Propagate failure of ssh command to caller of SshSupport
When SshSupport.runSshCommand fails since the executed external ssh
command failed throw a CommandFailedException.

If discovery of LFS server fails due to failure of the
git-lfs-authenticate command chain the CommandFailureException to the
LfsConfigInvalidException in order to allow root cause analysis in the
application using that.

Change-Id: I2f9ea2be11274549f6d845937164c248b3d840b2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-13 11:24:24 +02:00
Marcel Trautwein 5429d1a0cf Make JGit describe behaves same as c-git for lightweight tags
JGit now considers lightweight tags only if the --tags option is set
i.e. `git.describe().setAllTags(true)` has to be set, else the default
is now as in c git:

Only annotated tags are evaluated unless you pass true
equivalent to --tags (or --all) by the option setAllTags.

Hint: This (still) doesn't address any difference between c-git
`--all` and `!--all --tags` behavior;
perhaps this might be a follow up request

Bug: 423206
Change-Id: I9a3699756df0b9c6a7c74a7e8887dea0df17c8e7
Signed-off-by: Marcel Trautwein <me+eclipse@childno.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-13 09:37:47 +02:00
Markus Duft 01c52a58f6 Fix issues with LFS on GitHub (SSH)
* URIish seems to have a tiny feature (bug?). The path of the URI
   starts with a '/' only if the URI has a port set (it seems).
 * GitHub does not return SSH authorization on a single line as Gerrit
   does - need to account for that.
 * Increase the SSH git-lfs-authenticate timeout, as GitHub sometimes
   responds slower than expected.
 * Guard against NPE in case the download action does not contain any
   additional headers.

Change-Id: Icd1ead3d015479fd4b8bbd42ed42129b0abfb95c
Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
2018-06-12 09:49:15 +02:00
David Pursehouse 44137491dc Merge branch 'stable-5.0'
* stable-5.0:

Empty merge. The stable-4.9 branch was merged directly into stable-5.0
by [1], and then there were separate merges up through stable-4.10 to
stable-4.11 by [2] and [3].

When stable-4.11 was merged in to stable-5.0 in [4] it was an empty
merge, since the change had already been brought in by [1].

[1] https://git.eclipse.org/r/#/c/124301/-1..2
[2] https://git.eclipse.org/r/#/c/124320/-1..1
[3] https://git.eclipse.org/r/#/c/124321/-1..1
[4] https://git.eclipse.org/r/#/c/124332/-1..1

Change-Id: I91304b1bdad41837814d221971750b2b64bdcf6a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-06-12 13:23:58 +09:00
Matthias Sohn 747ad8b166 Merge branch 'stable-4.11' into stable-5.0
* stable-4.11:

Change-Id: Iec2dafd00979ab02f5ab698fc514866255007de5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-11 11:25:55 +02:00
Matthias Sohn c6f210a38b Merge branch 'stable-4.10' into stable-4.11
* stable-4.10:
  Ensure DirectoryStream is closed promptly

Change-Id: I2c0d5ea96b2c96336908674032d0f7d39dc062b9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-11 11:03:49 +02:00
Matthias Sohn e512d919ec Merge branch 'stable-4.9' into stable-4.10
* stable-4.9:
  Ensure DirectoryStream is closed promptly

Change-Id: I62674a1db9266c04fb353ab697e2c0a24a7369b7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-11 10:54:59 +02:00
David Pursehouse 0bcf88bc0d Merge branch 'stable-5.0'
* stable-5.0:
  Fix Javadoc typo

Change-Id: Ib864f5871f8e99d2a776b7ae9f782ec3eb312d50
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-06-11 08:09:09 +09:00
Michael Keppler e710f14ed1 Fix Javadoc typo
Change-Id: Ib4ebc57236bdea663f27295764886413e2550580
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-06-10 23:19:20 +09:00
Matthias Sohn 0f8f6746ed Merge branch 'stable-5.0'
* stable-5.0:
  Ensure Jsch checks all configured algorithms
  RawTextTest#testBinary: use array comparison to compare arrays
  LFS: Better SSH authentication token timeout handling
  Ensure DirectoryStream is closed promptly
  Validate branch names on branch creation

Change-Id: Ic4f6a24b6ccee6730eee3fd5dcb0d1f3e291c478
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-10 12:12:16 +02:00
Thomas Wolf 4ef8769f81 Ensure Jsch checks all configured algorithms
Jsch checks only for the availability of the algorithms given by
Jsch-internal config keys "CheckCiphers", "CheckKexes", and
"CheckSignatures". If the ssh config defines any algorithms
unknown to Jsch not listed in those keys, it'll still propose them
during the negotiation phase, and run into an NPE later on if the
server happens to propose such an algorithm and it gets chosen.

Jsch reads those "CheckCiphers" and the other values from either a
session-local config, or the global static Jsch config. It bypasses
~/.ssh/config for these values.

Therefore, copy these values from the config as read from
~/.ssh/config into the session-specific config. That makes Jsch
check _all_ configured algorithms up front, discarding any for
which it has no implementation. Thus it proposes only algorithms
it actually can handle.

Bug: 535672
Change-Id: I6a68e54f4d9a3267e895c536bcf3c58099826ad5
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-06-10 12:06:59 +02:00
Matthias Sohn 6cb0199ffc Merge branch 'stable-4.9' into stable-5.0
* stable-4.9:
  Ensure DirectoryStream is closed promptly

Change-Id: I447a01e1170db85fcf5978206ed35ad1956a2d82
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-10 09:23:52 +02:00
Matthias Sohn 5f8b6ebc9f RawTextTest#testBinary: use array comparison to compare arrays
Change-Id: Iac1feadf24858a0bdf0cb224f16b34e9498fe3bb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-09 14:42:55 +02:00
Markus Duft a9e6da1082 LFS: Better SSH authentication token timeout handling
* Larger eager timeout to compensate for high-latency lines
 * Respect eager timeout in case the server uses "expiresIn"

Change-Id: Id87da1eea874e70b69eaccf35c84af4c3bb50770
Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
2018-06-09 14:42:55 +02:00
Dave Borowitz 5fe8e31d43 Ensure DirectoryStream is closed promptly
From the javadoc for Files.list:

"The returned stream encapsulates a DirectoryStream. If timely disposal
of file system resources is required, the try-with-resources construct
should be used to ensure that the stream's close method is invoked
after the stream operations are completed."

This is the only call to Files#newDirectoryStream that is not already in
a try-with-resources.

Change-Id: I91e6c56b5d74e8435457ad6ed9e6b4b24d2aa14e
(cherry picked from commit 1c16ea4601)
2018-06-09 17:34:29 +09:00
Matthias Sohn 62460b42b7 Validate branch names on branch creation
Since v2.16.0-rc0~89^2~1 (branch: correctly reject
refs/heads/{-dash,HEAD}, 2017-11-14),
native git does not allow branch names
- refs/heads/HEAD
- starting with '-'

Bug: 535655
Change-Id: Ib1c4ec9ea844073901a4ebe6a29ff6cc8ae58e93
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-06-09 01:20:13 +02:00
Jonathan Nieder d2cb1e7bf5 Merge branch 'stable-5.0'
* stable-5.0:
  Use constant for ".lock"
  Simplify locking of FileRepository's index snapshot
  Refactor FileRepository.detectIndexChange()

Change-Id: Ifd427711359bcf38b2c877b2143d45bff0c9895a
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-06-08 14:56:06 -07:00