Previous code could potentially dereference nil - this PR ensures
that the poster is loaded before dereferencing it.
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add migration test
This commit adds a simple migration test for v1.5.3, v1.6.4 and v1.7.0-rc3
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Automigrate based on available dbs
* remove old ini file
* Standardise the dialect names
Add a new config option to enable / disable the automatic watching of
repos for new repositories and if a user is added to a team.
Fixes #653
Signed-off-by: Sebastian Sauer <sauer.sebastian@gmail.com>
Move input fields to the top so no scrolling is needed to add
new members / repos to a team.
Signed-off-by: Sebastian Sauer <sauer.sebastian@gmail.com>
* Ensure valid git author names passed in signatures
Fix #5772 - Git author names are not allowed to include `\n` `<` or `>` and
must not be empty. Ensure that the name passed in a signature is valid.
* Account for pathologically named external users
LDAP and the like usernames are not checked in the same way that users who signup are.
Therefore just ensure that user names are also git safe and if totally pathological -
Set them to "user-$UID"
* Add Tests and adjust test users
Make our testcases a little more pathological so that we be sure that integration
tests have a chance to spot these cases.
Signed-off-by: Andrew Thornton <art27@cantab.net>
Updates documentation to account for the renamed ENABLE_SWAGGER_ENDPOINT from #3572 (commit a74426d631)
Signed-off-by: Peter Colberg <peter@colberg.org>
* Optimize pulls merging
By utilizing `git clone -s --no-checkout` rather than cloning the whole
repo.
* Use sparse-checkout to speedup pulls merge
* Use bytes.Buffer instead of strings.Builder for backward compatibility
* Fix empty diff-tree output for repos with only the initial commit
* Fix missing argument for the format string
* Rework diff-tree-list generation
* Remove logging code
* File list for sparse-checkout must be prefix with /
Otherwise, they would match all files with the same name under
subdirectories.
* Update onto the rebased head
* Use referecen repo to avoid fetching objects
* Pooled and buffered gzip implementation
* Add test for gzip
* Add integration test
* Ensure lfs check within transaction
The previous code made it possible for a race condition to occur whereby a LFSMetaObject could be checked into the database twice. We should check if the LFSMetaObject is within the database and insert it if not in one transaction.
* Try to avoid primary key problem in postgres
The integration tests are being affected by
https://github.com/go-testfixtures/testfixtures/issues/39 if we set the
primary key high enough, keep a count of this and remove at the end of
each test we shouldn't be affected by this.