Commit Graph

8308 Commits

Author SHA1 Message Date
Nasser Grainawi c57b2935cd PackExt: Convert to Enum
This class already looked very much like an Enum, but wasn't one.

As an Enum, we can use PackExt in EnumMaps and EnumSets. Convert the
Map key usage in PackDirectory to an EnumMap.

Change-Id: Ice097fd468a05805f914e6862fbd1d96ec8c45d1
Signed-off-by: Nasser Grainawi <quic_nasserg@quicinc.com>
2021-03-04 22:51:20 +01:00
Martin Fick 6167641834 Restore preserved packs during missing object seeks
Provide a recovery path for objects being referenced during the pack
pruning race. Due to the pack pruning race, it is possible for objects
to become referenced after a pack has been deemed safe to prune, but
before it actually gets pruned. If this happened previously, the newly
referenced objects would be missing and potentially result in a
corrupted ref.

Add the ability to recover from this situation when an object is missing
but happens to still be available in a pack in the "preserved"
directory. This is likely only useful when used in conjunction with the
--preserve-old-packs GC option, which prunes packs by hard-linking to
the preserved directory. If an object is missing and found in a pack in
the preserved directory, immediately recover that pack and its
associated files (idx, bitmaps...) by moving them back to the original
pack directory, and then retry the operation that would have failed due
to the missing object. This retry can now succeed and the repository
may avoid corruption. This approach should drastically reduce the
chance of a corrupt repository during pack pruning at very little extra
cost. This extra cost should only be incurred when objects are missing
and a failure would normally occur.

Change-Id: I2a704e3276b88cc892159d9bfe2455c6eec64252
Signed-off-by: Martin Fick <quic_mfick@quicinc.com>
Signed-off-by: Nasser Grainawi <quic_nasserg@quicinc.com>
2021-03-04 22:31:40 +01:00
Nasser Grainawi 7fbff35887 Pack: Replace extensions bitset with bitmapIdx PackFile
The only extension that was ever consulted from the bitmap was the
bitmap index. We can simplify the Pack code as well as the code of
all the callers if we focus on just that usage.

Change-Id: I799ddfdee93142af67ce5081d14a430d36aa4c15
Signed-off-by: Nasser Grainawi <quic_nasserg@quicinc.com>
2021-03-04 22:25:48 +01:00
Nasser Grainawi 49c89285a7 PackDirectory: Use PackFile to ensure we find preserved packs
Update scanPacksImpl and listPackDirectory (renamed to
getPackFilesByExtById) to use the new PackFile functionality to
validate file names and complete pack file sets (.pack, .idx, etc).

Most importantly, this allows a later change to rely on scanPacks() to
complete a packList that contains packs with the 'old-' prefix in their
extension.

This also eliminates duplication of logic for how to identify and
construct pack files.

Change-Id: I7175e5fefb187a29e0a7cf53c392aee922314f31
Signed-off-by: Nasser Grainawi <quic_nasserg@quicinc.com>
2021-03-04 22:23:39 +01:00
Nasser Grainawi dc7f0bfee9 GC: Use PackFile to de-dup logic
GC has several places where it tries to build files names for packs that
we can use the PackFile class for instead.

Change-Id: I99e5ceff9050f8583368fca35279251955e4644d
Signed-off-by: Nasser Grainawi <quic_nasserg@quicinc.com>
2021-03-04 22:19:39 +01:00
Nasser Grainawi 971dafd302 Create a PackFile class for Pack filenames
The PackFile class is intended to be a central place to do all
common pack filename manipulation and parsing to help reduce repeated
code and bugs. Use the PackFile class in the Pack class and in many
tests to ensure it works well in a variety of situations. Later changes
will expand use of PackFiles to even more areas.

Change-Id: I921b30f865759162bae46ddd2c6d669de06add4a
Signed-off-by: Nasser Grainawi <quic_nasserg@quicinc.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-03-04 22:19:36 +01:00
Matthias Sohn 1172c0b283 Prepare 5.11.0-SNAPSHOT builds
Change-Id: I89ed49a6acc53dd75d16f40c99e1140e0c18f646
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-03-04 16:27:51 +01:00
Matthias Sohn d60dd72310 JGit v5.11.0.202103031150-rc1
Change-Id: I0a86fa59645888f9f36ea6938c9121e095f02fc6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-03-03 17:48:00 +01:00
Matthias Sohn c900c22bb1 Merge branch 'master' into stable-5.11
* master:
  HTTP: cookie file stores expiration in seconds
  Update Orbit to S20210223232630
  LFS: handle invalid pointers better
  Fix errorprone configuration for maven-compiler-plugin with javac

Change-Id: Ib76e754bd36789de0a3c6b85a4814aa1fe9cb401
2021-03-03 17:44:20 +01:00
Thomas Wolf 40d6eda3f1 HTTP: cookie file stores expiration in seconds
A cookie file stores the expiration in seconds since the Linux Epoch,
not in milliseconds. Correct reading and writing cookie files; with
a backwards-compatibility hack to read files that contain a millisecond
timestamp.

Add a test, and fix tests not to rely on the actual current time so
that they will also run successfully after 2030-01-01 noon.

Bug: 571574
Change-Id: If3ba68391e574520701cdee119544eedc42a1ff2
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-03-03 00:26:51 +01:00
Matthias Sohn 535f446a2e Merge "Update Orbit to S20210223232630" 2021-03-02 11:07:49 -05:00
Matthias Sohn a534d3d90a Update Orbit to S20210223232630
Change-Id: Ida7a54cfe0bd15c1c28b892dea3452958924f0c0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-03-01 22:10:22 +01:00
Thomas Wolf 616a88895d LFS: handle invalid pointers better
Make sure that SmudgeFilter calls LfsPointer.parseLfsPointer() with
a stream that supports mark/reset, and make sure that parseLfsPointer()
resets the stream properly if it decides that the stream content is not
a LFS pointer.

Add a test.

Bug: 570758
Change-Id: I2593d67cff31b2dfdfaaa48e437331f0ed877915
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-03-01 15:53:07 -05:00
Matthias Sohn b126372448 Fix errorprone configuration for maven-compiler-plugin with javac
See https://errorprone.info/docs/installation.

Add new profile jdk8 to enable running errorprone with javac on java 8
and java 11. Remove errorprone configuration from benchmark module,
didn't find a way to make it work and this module does not contain any
productive code.

Change-Id: I6a84195af05e6cea9e7c04ad5cd4c79742e80cb3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-02-27 21:00:30 +01:00
Matthias Sohn 789c0479a9 Merge branch 'stable-5.11'
* stable-5.11:
  Prepare 5.11.0-SNAPSHOT builds
  JGit v5.11.0.202102240950-m3

Change-Id: Ia216a698dd4f0dd235dfe4de4d2cc127aa530eed
2021-02-25 09:09:57 +01:00
Matthias Sohn 83d4f19a30 Prepare 5.11.0-SNAPSHOT builds
Change-Id: If3dbe084ee37ae4b993d3a10ec48b14e8709ff6d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-02-24 21:21:34 +01:00
Matthias Sohn 9eacae28df JGit v5.11.0.202102240950-m3
Change-Id: Iea6b3515fa63db497989194b6bf50fe7324086d0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-02-24 15:50:41 +01:00
Matthias Sohn 1b7eafab13 Merge branch 'master' into stable-5.11
* master: (35 commits)
  [releng] japicmp: update last release version
  IgnoreNode: include path to file for invalid .gitignore patterns
  FastIgnoreRule: include bad pattern in log message
  init: add config option to set default for the initial branch name
  init: allow specifying the initial branch name for the new repository
  Fail clone if initial branch doesn't exist in remote repository
  GPG: fix reading unprotected old-format secret keys
  Update Orbit to S20210216215844
  Add missing bazel dependency for o.e.j.gpg.bc.test
  GPG: handle extended private key format
  dfs: handle short copies
  [GPG] Provide a factory for the BouncyCastleGpgSigner
  Fix boxing warnings
  GPG: compute the keygrip to find a secret key
  GPG signature verification via BouncyCastle
  Post commit hook failure should not cause commit failure
  Allow to define additional Hook classes outside JGit
  GitHook: use default charset for output and error streams
  GitHook: use generic OutputStream instead of PrintStream
  Update jetty to 9.4.36.v20210114
  ...

Change-Id: I1cf5ab262c67b986e82422c48dfc103e335d28cc
2021-02-24 14:54:52 +01:00
Thomas Wolf 9bfb0f3a4e [releng] japicmp: update last release version
The baseline for the 5.11 release is 5.10.0.202012080955-r.

Change-Id: Ied9b42dc58ba981e5586fa58d1b3e70a39c78a10
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-02-23 18:12:18 -05:00
Thomas Wolf 29697d86c5 IgnoreNode: include path to file for invalid .gitignore patterns
Include the full file path of the .gitignore file and the line number
of the invalid pattern. Also include the pattern itself.

.gitignore files inside the repository are reported with their
repository-relative path; files outside (from git config
core.excludesFile or .git/info/exclude) are reported with their
full absolute path.

Bug: 571143
Change-Id: Ibe5969679bc22cff923c62e3ab9801d90d6d06d1
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-02-23 22:11:01 +01:00
Thomas Wolf 4e745c57f7 FastIgnoreRule: include bad pattern in log message
When a .gitignore pattern cannot be parsed include the pattern in the
log message. Just reporting "not closed bracket" isn't helpful if the
user doesn't know in which pattern the problem occurred.

Even better would be to include the full path of the .gitignore file
that contained the offending pattern. This is not implemented in this
change; it may need new API and needs more thought.

Bug: 571143
Change-Id: Id5b16d9cf550544ba3ad409a02041946fa8516ab
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-02-23 22:11:01 +01:00
Matthias Sohn 927deed5a5 init: add config option to set default for the initial branch name
We introduced the option --initial-branch=<branch-name> to allow
initializing a new repository with a different initial branch.

To allow users to override the initial branch name more permanently
(i.e. without having to specify the name manually for each 'git init'),
introduce the 'init.defaultBranch' option.

This option was added to git in 2.28.0.

See https://git-scm.com/docs/git-config#Documentation/git-config.txt-initdefaultBranch

Bug: 564794
Change-Id: I679b14057a54cd3d19e44460c4a5bd3a368ec848
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-02-22 23:11:45 +01:00
Matthias Sohn cb8924a80d init: allow specifying the initial branch name for the new repository
Add option --initial-branch/-b to InitCommand and the CLI init command.
This is the first step to implement support for the new option
init.defaultBranch. Both were added to git in release 2.28.

See https://git-scm.com/docs/git-init#Documentation/git-init.txt--bltbranch-namegt

Bug: 564794
Change-Id: Ia383b3f90b5549db80f99b2310450a7faf6bce4c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-02-22 23:11:45 +01:00
Matthias Sohn 64cb7148ac Fail clone if initial branch doesn't exist in remote repository
jgit clone --branch foo <url>

did not fail if the remote branch "foo" didn't exist in the remote
repository being cloned.

Bug: 546580
Change-Id: I55648ad3a39da4a5711dfa8e6d6682bb8190a6d6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-02-22 23:11:44 +01:00
Thomas Wolf 704ccdc096 GPG: fix reading unprotected old-format secret keys
Fix code and add a test case. The old code passed on the original input
stream, which has already been consumed.

Bug: 570501
Change-Id: I81f60698ce42443df57e59b1d1ab155574136fa8
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-02-22 09:43:18 +01:00
Matthias Sohn 81a76383a1 Update Orbit to S20210216215844
Change-Id: Ic3af137e4aad0e6f7fd32c910766f547562442d6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-02-21 00:01:22 +01:00
Matthias Sohn 7e38792ead Add missing bazel dependency for o.e.j.gpg.bc.test
This was missed in 64cbea8a97.

Change-Id: I0b2b234b9888a7dd8b7ace624233b141fb7c4394
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-02-20 21:32:57 +01:00
Thomas Wolf bdc48aeac7 GPG: handle extended private key format
Add detection for the key-value pair format that was available in
gpg-agent for some time already and that has become the default since
gpg-agent 2.2.20. If a secret key in the .gnupg/private-keys-v1.d
directory is found to have this format, extract the human-readable key
from it, convert it to the binary serialized form and hand that to
BouncyCastle.

Encrypted keys in the new format may use AES/OCB. OCB is a patent-
encumbered algorithm; although there is a license for open-source
software, that may not be good enough and OCB may not be available in
Java. It is not available in the default security provider in Java,
and it is also not available in the BouncyCastle version included in
Eclipse.

Implement AES/OCB decryption, throwing a PGPException with a nice
message if the algorithm is not available. Include a copy of the normal
s-expression parser of BouncyCastle and fix it to properly handle data
from such keys: such keys do not contain an internal hash since the
AES/OCB cipher includes and checks a MAC already.

Bug: 570501
Change-Id: Ifa6391a809a84cfc6ae7c6610af6a79204b4143b
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-02-19 18:24:47 -05:00
wh a14455dfd7 dfs: handle short copies
`copy` is documented as possibly returning a smaller number of bytes
than requested. In practice, this can occur if a block is cached and the
reader never pulls in the file to check its size.

Bug: 565874
Change-Id: I1e53b3d2f4ab09334178934dc0ef74ea99045cd3
Signed-off-by: wh <wh9692@protonmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-02-19 17:34:04 -05:00
Thomas Wolf 27fbd8bf56 Merge "[GPG] Provide a factory for the BouncyCastleGpgSigner" 2021-02-19 02:57:38 -05:00
Thomas Wolf cd12b570ff [GPG] Provide a factory for the BouncyCastleGpgSigner
Otherwise client code has no way to ever create an instance without
using internal non-API.

Change-Id: I6201f98d4b1704a053159967b8adacd98e368522
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-02-19 08:10:39 +01:00
Jonathan Nieder f1312b4a90 Merge "Rename PackFile to Pack" 2021-02-18 17:04:07 -05:00
Matthias Sohn 3b94ba6c24 Fix boxing warnings
Change-Id: Idf4887a99e87c375ec32e2fd289cfce82d78cbce
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-02-17 16:24:34 -05:00
Thomas Wolf 64cbea8a97 GPG: compute the keygrip to find a secret key
The gpg-agent stores secret keys in individual files in the secret
key directory private-keys-v1.d. The files have the key's keygrip
(in upper case) as name and extension ".key".

A keygrip is a SHA1 hash over the parameters of the public key. By
computing this keygrip, we can pre-compute the expected file name and
then check only that one file instead of having to iterate over all
keys stored in that directory.

This file naming scheme is actually an implementation detail of
gpg-agent. It is unlikely to change, though. The keygrip itself is
computed via libgcrypt and will remain stable according to the GPG
main author.[1]

Add an implementation for calculating the keygrip and include tests.
Do not iterate over files in BouncyCastleGpgKeyLocator but only check
the single file identified by the keygrip.

Ideally upstream BouncyCastle would provide such a getKeyGrip() method.
But as it re-builds GPG and libgcrypt internals, it's doubtful it would
be included there, and since BouncyCastle even lacks a number of curve
OIDs for ed25519/curve25519 and uses the short-Weierstrass parameters
instead of the more common Montgomery parameters, including it there
might be quite a bit of work.

[1] http://gnupg.10057.n7.nabble.com/GnuPG-2-1-x-and-2-2-x-keyring-formats-tp54146p54154.html

Bug: 547536
Change-Id: I30022a0e7b33b1bf35aec1222f84591f0c30ddfd
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-02-16 00:37:01 +01:00
Thomas Wolf 3774fcc848 GPG signature verification via BouncyCastle
Add a GpgSignatureVerifier interface, plus a factory to create
instances thereof that is provided via the ServiceLoader mechanism.

Implement the new interface for BouncyCastle. A verifier maintains
an internal LRU cache of previously found public keys to speed up
verifying multiple objects (tag or commits). Mergetags are not handled.

Provide a new VerifySignatureCommand in org.eclipse.jgit.api together
with a factory method Git.verifySignature(). The command can verify
signatures on tags or commits, and can be limited to accept only tags
or commits. Provide a new public WrongObjectTypeException thrown when
the command is limited to either tags or commits and a name resolves
to some other object kind.

In jgit.pgm, implement "git tag -v", "git log --show-signature", and
"git show --show-signature". The output is similar to command-line
gpg invoked via git, but not identical. In particular, lines are not
prefixed by "gpg:" but by "bc:".

Trust levels for public keys are read from the keys' trust packets,
not from GPG's internal trust database. A trust packet may or may
not be set. Command-line GPG produces more warning lines depending
on the trust level, warning about keys with a trust level below
"full".

There are no unit tests because JGit still doesn't have any setup to
do signing unit tests; this would require at least a faked .gpg
directory with pre-created key rings and keys, and a way to make the
BouncyCastle classes use that directory instead of the default. See
bug 547538 and also bug 544847.

Tested manually with a small test repository containing signed and
unsigned commits and tags, with signatures made with different keys
and made by command-line git using GPG 2.2.25 and by JGit using
BouncyCastle 1.65.

Bug: 547751
Change-Id: If7e34aeed6ca6636a92bf774d893d98f6d459181
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-02-16 00:37:00 +01:00
Tim Neumann 15a38e5b4f Post commit hook failure should not cause commit failure
As the post commit hook is run after a commit is finished, it can not
abort the commit and the exit code of this hook should not have any
effect.

This can be achieved by not throwing a AbortedByHookException exception.
The stderr output is not lost thanks to contributions for bug 553471.

Bug: 553428
Change-Id: I451a76e04103e632ff44e045561c5a41f7b7d558
Signed-off-by: Tim Neumann <Tim.Neumann@advantest.com>
Signed-off-by: Fabian Pfaff <fabian.pfaff@vogella.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-02-15 16:45:59 +01:00
Matthias Sohn 935c8b752b Allow to define additional Hook classes outside JGit
EGit wants to add gitflow specific hooks in org.eclipse.egit.gitflow.
Make GitHook public to allow sub-classing outside of the
org.eclipse.jgit.hooks package.

Change-Id: I439575ec901e3610b5cf9d66f7641c8324faa865
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-02-15 16:45:59 +01:00
Matthias Sohn f17f8e8ba9 GitHook: use default charset for output and error streams
External scripts most probably expect the default charset.

Change-Id: I318a5e1d9f536a95e70c06ffb5b6f408cd40f73a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-02-15 16:45:58 +01:00
Matthias Sohn 5b528474f5 GitHook: use generic OutputStream instead of PrintStream
Change-Id: I15e64dc963c9d27dc9c8de4976dd63f74b918b15
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-02-15 16:45:58 +01:00
Matthias Sohn 7cc1a52c66 Update jetty to 9.4.36.v20210114
Change-Id: Iea57f0fddb0f10dbd1c9be886bfa5ad8c3ff5cb5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-02-13 22:17:43 +01:00
Nasser Grainawi efb154fc24 Rename PackFile to Pack
Pack better represents the purpose of the object and paves the way to
add a PackFile object that extends File.

Change-Id: I39b4f697902d395e9b6df5e8ce53078ce72fcea3
Signed-off-by: Nasser Grainawi <quic_nasserg@quicinc.com>
2021-02-10 22:46:15 -07:00
Marija Savtchouk 1b9911d9ae Allow dir/file conflicts in virtual base commit on recursive merge.
If RecursiveMerger finds multiple base commits, it tries to compute
the virtual ancestor to use as a base for the three way merge.
Currently, the content conflicts between ancestors are ignored (file
staged with the conflict markers). If the path is a file in one ancestor
and a dir in the other, it results in NoMergeBaseException
(CONFLICTS_DURING_MERGE_BASE_CALCULATION).

Allow these conflicts by ignoring this unmerged path in the virtual
base. The merger will compute diff in the children instead and it
can be further fixed manually if needed.

Change-Id: Id59648ae1d6bdf300b26fff513c3204317b755ab
Signed-off-by: Marija Savtchouk <mariasavtchouk@google.com>
2021-02-09 15:26:03 +00:00
Christian Halstrick fe4b2a4656 Merge "GitHook: make fields outputStream and errorStream private" 2021-02-09 02:07:53 -05:00
Matthias Sohn 686565f416 GitHook: make fields outputStream and errorStream private
Subclasses can use the corresponding getter methods.

Change-Id: Iaa9ab01f5a9731a264b28608d2418a9405b601d7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-02-09 02:42:47 +01:00
Thomas Wolf 6d462e5fe9 GPG: support git config gpg.program
Add it to the GpgConfig. Change GpgConfig to load the values once only.
Add a parameter to the GpgObjectSigner interface's operations to pass
in a GpgConfig. Update CommitCommand and TagCommand to pass the value
to the signer. Let the signer decide whether it can actually produce
the wanted signature type (openpgp or x509).

No behavior change. But this makes it possible to implement different
signers that might support x509 signatures, or use gpg.program and
shell out to an external GPG executable for signing.

Change-Id: I427f83eb1ece81c310e1cddd85315f6f88cc99ea
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-02-07 17:32:30 -05:00
David Ostrovsky 19bed3399d Bump bazel version to 4.0.0
Change-Id: I2faa67d5083f23b29f7a434e54c5e17360b1c0fe
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
2021-02-07 23:06:25 +01:00
David Ostrovsky 7755645777 Bazel: Remove unused resources variable
Change-Id: Iac2e547791929c26027ab4730ceac6177899ccf1
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
2021-02-07 23:06:25 +01:00
Adithya Chakilam c7685003d8 Fix DateRevQueue tie breaks with more than 2 elements
DateRevQueue is expected to give out the commits that have higher
commit time. But in case of tie(same commit time), it should give
the commit that is inserted first. This is inferred from the
testInsertTie test case written for DateRevQueue. Also that test
case, right now uses just two commits which caused it not to fail
with the current implementation, so added another commit to make
the test more robust.

By fixing the DateRevQueue, we would also match the behaviour of
LogCommand.addRange(c1,c2) with git log c1..c2. A test case for
the same is added to show that current behaviour is not the
expected one.

By fixing addRange(), the order in which commits are applied during
a rebase is altered. Rebase logic should have never depended upon
LogCommand.addRange() since the intended order of addRange() is not
the order a rebase should use. So, modify the RebaseCommand to use
RevWalk directly with TopoNonIntermixSortGenerator.

Add a new LogCommandTest.addRangeWithMerge() test case which creates
commits in the following order:

         A - B - C - M
              \     /
                -D-

Using git 2.30.0, git log B..M outputs:  M C D
LogCommand.addRange(B, M) without this fix outputs: M D C
LogCommand.addRange(B, M) with this fix outputs: M C D

Change-Id: I30cc3ba6c97f0960f64e9e021df96ff276f63db7
Signed-off-by: Adithya Chakilam <achakila@codeaurora.org>
2021-02-07 06:09:48 -05:00
Lars Vogel 3259a96021 Field updateHead can be a local variable in RefDirectoryRename
Keeping the field updateDate is unecessary, as it is set and used only
in the doRename method.

Change-Id: I1cdd1adf759b75c103480db7a74cec8c2d78b794
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
2021-02-06 19:50:43 -05:00
Matthias Sohn 58f2e23fde Fix FileRepository#convertToReftable which failed if no reflog existed
Deleting non-existing files when converting to reftable without backup
caused convertToReftable to fail. Observed this on a mirrored repository
which had no reflogs. Fix this by skipping missing files during
deletion.

Change-Id: I3bb913d5bfddccc6813677b873006efb849a6ebc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-02-05 20:48:51 -05:00