summaryrefslogtreecommitdiffstats
path: root/src/test/java/com/gitblit/tests/JGitUtilsTest.java
Commit message (Collapse)AuthorAgeFilesLines
* Fix revLog test that broke due to changes in the hello-world repository.Florian Zschocke2019-06-101-3/+4
|
* Create unit tests for special characters in path namesFlorian Zschocke2019-06-101-1/+13
| | | | | | | Create a regression test for issue #999. Add directories with '[]' ans '()' in the name to the hello-world repository, so that they can be used in unit tests for repository paths with special characters.
* Do not resolve symbolic links to repositories.Florian Zschocke2019-06-101-0/+117
| | | | | | | | | | | | | | When symbolic links under the base repository folder point to repositories outside the base repository folder, the forming of relative repository names failed and resulted in NullPointerExceptions. Create the relative path by not following symbolic links, i.e. the link name is taken as is and not resolved to the external path. This also changes the whole `exactPath` method to work on Paths, instead of Files. Fixes #891 and fixes #837.
* Zips of recreated hello-world.git and all external repositories for testing.chirontt2019-06-071-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This hello-world.git repo is created using the native Git for Windows software. Various test classes in the GitBlitSuite test suite require the presence of the hello-world.git repo in github.com/git/ which has been missing, hence causing many test failures in the suite. This recreation of the hello-world.git repo aims to conform to the many test cases' requirements in the suite, and to be checked in as part of the gitblit repo, thus eliminates the requirement of a remote hello-world.git repo during the test run. The repo is now stored is a zip ball in the new src/test/data folder. The hello-world repo's various commit IDs were hard-coded in various test classes. These commit IDs, which must now have new values in the recreated repo, are now extracted out to the src/test/data/hello-world.properties file. The gitblit's build.xml is modified to generate the HelloworldKeys.java file containing the hello-world.properties file's key strings, in similar fashion as the existing generation of the com.gitblit.Keys.java file. And these key strings in HelloworldKeys.java are now used in the various test classes, thus eliminating the hard-coding of the hello-world repo's commit IDs in the test code. During the test run by GitBlitSuite test suite, some repos from GitHub were cloned and became part of the test data. These repos are now zipped to be part of gitblit repo itself, thus eliminating the network fetch at the start of test run which can be slow, especially with the JGit repo cloning which is huge and time consuming. The cloned JGit repo is now zipped and checked in to gitblit, along with the other 4 repos (hello-world, ambition, gitective and ticgit). They will be unzipped during the test suite run and be available in the local file system, thus avoiding the need for some network fetch. Special note on the zipped JGit repo: this repo is big (and growing all the time on GitHub), and takes up about 32MB of disk space after cloning from GitHub. I've made it smaller by resetting HEAD back to a commit of 5 years ago (with git reset --hard <commitId> command), to put it back to roughly where/when the tests were written for it (which is not quite, because there are tons of commit history since which can't be removed.) The local JGit repo is then garbage-collected (with git gc --prune --aggressive) to reduce its size to about 19MB. Zipped it is still 17MB. This is a lot of MBs for a few tests. So the JGit repo is not included in this commit. Fixes #1275
* Fix for #976 - Filestore links via browserPaul Martin2015-12-251-3/+3
| | | | | | | | | | | | | + GitLFS client support + FilestoreModel now parses meta file + Read meta heading from cache if available + Authentication based on accept headers for browser view filestore login + PathModel & PathChangeModel now understands filestore items + Zip & Rar downloads contain include filestore items + Filestore servlet returns LFS JSON error only if accepted by client + DiffStat now knows repository to allow identification of filestore items + Filestore items identified and returned via view, raw & blob links on blame, commitDiff, commit and Tree pages
* #230 - Improve empty folder navigation.Milos Cubrilo2015-01-111-0/+9
| | | | Empty folders are automatically skipped when browsing repository tree (similar to github "folder jumping" feature).
* Correct unit test assertionJames Moger2014-10-201-1/+1
|
* [findbugs] Reorder asserts to avoid potential NPE in JGitUtilsTestJames Moger2014-04-171-3/+5
|
* Fixed test.Alex Lewis2013-12-231-1/+1
| | | | | | testRevlog was expecting 12 commits but getting 19. Looking at the hello-world repository on github (on which the test executes) the 19 commit count appears to be correct.
* Define manager interfaces and update all of Gitblit to use managersJames Moger2013-11-261-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | These manager interfaces define how the GitBlit singleton will eventually be split into smaller component managers. The Wicket app and all servlets have been updated to request the needed managers. There are _very_ few method signature changes - although there are a handful. This is a surgical sharding of responsibility based on a proof of concept refactor. Instead of random references to GittBlit.self() there are now precise references to the manager interface required to accomplish some task. Some tasks may require references to multiple managers. The code is now littered with calls to GitBlit.getManager(class) and those familiar with the code-base will no doubt notice the duplication of methods from IUserService in IUserManager and the addition of implementation methods in the GitBlit context class. When the GitBlit class is broken apart and the existing external authentication user service classes are refactored to AuthenticationService classes, this will again simplify and flatten. But in order to safely and cleanly modularize the stable code-base we will have to live with a little duplication for a short while. Change-Id: I7314ec8acaab2dcc6092785ed4434cc09fdbbe16
* Fix Markdown document enumeratonJames Moger2013-10-161-6/+1
|
* Remove trailing whitespace from unit testsJames Moger2013-09-301-15/+15
| | | | Change-Id: I172bd4d493eee1013ec542ab97f1be29040f816d
* Implemented a graph servlet based on EGit/JGit's PlotWalk (issue-194)James Moger2013-09-171-1/+17
| | | | | | | | | The graph is generated server-side and therefore requires that the commit table row height be fixed and match the row height of the servlet. There will be layout misalignment if remotes refs are displayed. Perhaps this can be improved in the future. Change-Id: I39d0ffc7b1c3679976ce8c198c772ff86238f1a5
* Fix set-gid bit clearing under Linux when effective gid is different from ↵Florian Zschocke2013-08-261-0/+64
| | | | file gid.
* Fix setting wrrong custom mode on file and in config.Florian Zschocke2013-08-261-0/+36
|
* Adjust unit tests for Windows.Florian Zschocke2013-08-261-7/+11
|
* Implement adjusting file permissions for shared repositories.Florian Zschocke2013-08-261-6/+15
| | | | | Implement adjusting file and directory permissions for shared repositories in JGitUtils.
* Add proper implementation of methods in JnaUtils.Florian Zschocke2013-08-261-0/+21
| | | | | | | Implement the methods getFilemode and setFilemode in JnaUtils. Not using the libc names as we don't necessarily use JNA and because it is not necessarily a one to one mapping.
* Set author as tooltip of "last change" on repositories page (issue-238)James Moger2013-07-031-3/+3
|
* Reorganized to Apache Standard Directory Layout & integrated MoxieJames Moger2013-03-271-0/+472
This is a massive commit which reorganizes the entire project structure (although it is still monolithic), removes the Build classes, and switches to Moxie, a smarter Ant build tookit based on the original Gitblit Build classes. The Ant build script will likely require additional fine-tuning, but this is big step forward.