This new modifications provider consistently computes the modifications caused by a push to a branch. In contrast to the changeset provider that often has been used before to check what has changed, this also works for forced updates, rebased branches and fast-forwards.

Because these types of changes are normally only used with git, this provider (for now) has only been implemented for git.
Pushed-by: Rene Pfeuffer<rene.pfeuffer@cloudogu.com>
Pushed-by: Alexander Dammeier<alexander.dammeier@cloudogu.com>
Co-authored-by: René Pfeuffer<rene.pfeuffer@cloudogu.com>
Committed-by: René Pfeuffer<rene.pfeuffer@cloudogu.com>
Pass the ancestor commit as the old revision if it is set in the GitDiffResult. This fixes the image diff renderer if the pull requests consists of multiple commits to show the full diff instead of the changes between the latest two commits.
The initialization to set the default branch in
git repositories should not be executed for
non-git repositories. Otherwise, this throws
exceptions in SVN repositories all the time
because the branch command is not supported.
Committed-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
This fixes the check for LFS files used in git imports
and mirror command.
First this checks for LFS files recursively in the tree
(in other words, before LFS files were found only in
the root directory).
Second, this fixes a bug in the used JGit lfs filter by
checking, whether the checked tree entry is a normal
file. This prevents missing object exceptions during
the check when the repository contains a submodule.
Committed-by: Thomas Zerr <thomas.zerr@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
The git mirror command did not set the default branch correctly in all cases. If the source repository contained a 'master' branch, no default branch was set. This led to an error in the refresh process, when globally another branch has been configured as dafault (when not changed, this is 'main'), because the working copy should be created with the main branch checked out. Because no default was specified, the globally configured default (by default 'main') had been taken and that branch does not exist in the mirror.
So all subsequent mirror updates failed with a message like this one:
could not find branch with id main in repository with id ...
With this fix, the default branch is always set in the SCM-Manager configuration for the repository and therefore cannot be missing in subsequent updates.
Committed-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
Use standard configuration store api for general configuration. This is best practice and also required for the audit log to work properly.
Besides that we still need to load the general configuration manually for the instance injection binding in ScmServletModules. Since the instance injection does not resolve the bindings regularly we need also still need to update the injectable scm config using the "load" hack in the resource.
Committed-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
Changes made by the SCM-Manager, like those through the editor and pull requests, now more accurately define the committer on the underlying changeset.
Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
The validation for branch and tag names has been
too limited. This led to errors in the frontend for
branches, that had been created using the
cli tools for git or hg but have not been seen as
valid by SCM-Manager.
To fix this, the patterns to validate branch and
tag names are relaxed and relate to the git
rules (https://git-scm.com/docs/git-check-ref-format).
Because these rules could not be expressed
using regular expressions alone, in addition
possible exceptions will be handled in the
git branch and tag commands.
Committed-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
This uses 'RetryingTest' from junit jupiter to retry integration tests that are known to fail from time to time. We explicitly mark single tests in contrast to set a global retry to be able to trace those, whenever this is intended.
To do so, we have to update to the latest version of JUnit. Unfortunately, this brought a new behaviour for the @TempDir annotation: In contrast to the former behaviour where for one test all annotated parameters got the same directory, in the new version the parameters get different directories assigned. This led to the need of some consolidation between @BeforeEach methods and the related tests.
Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>