Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException on startup when having symbolically linked directories (non-relative) in the repository folder #891

gitblit opened this issue Aug 12, 2015 · 2 comments


Copy link

gitblit commented Aug 12, 2015

Originally reported on Google Code with ID 595

What steps will reproduce the problem?


2. create a symlink in /tools/repository to the 'other' git repo
cd /tools/repository/
ln -s /tools/repo/test2.git

3. use 
git.repositoriesFolder = /tools/repository/

4. start gitblit (standalone or within tomcat)

1.6.1, 1.6.2, 1.6.3.snapshot

        at com.gitblit.utils.StringUtils.compareRepositoryNames(
        at com.gitblit.utils.StringUtils$
        at com.gitblit.utils.StringUtils$
        at java.util.TimSort.countRunAndMakeAscending(
        at java.util.TimSort.sort(
        at java.util.TimSort.sort(
        at java.util.Arrays.sort(
        at java.util.Collections.sort(
        at com.gitblit.utils.StringUtils.sortRepositorynames(
        at com.gitblit.utils.JGitUtils.getRepositoryList(
        at com.gitblit.manager.RepositoryManager.getRepositoryList(
        at com.gitblit.manager.RepositoryManager.start(
        at com.gitblit.manager.RepositoryManager.start(

The error happens in
FileUtils.getRelativePath(baseFile, file); will return null for the sym-link, which
then later results in the NPE when sorting the repository names.

                        // determine repository name relative to base path
                        String repository = FileUtils.getRelativePath(baseFile, file);

Reported by christoph.luder on 2015-05-31 07:02:51

Copy link
Owner Author

gitblit commented Aug 12, 2015

Try the develop branch.

Reported by James.Moger on 2015-05-31 16:29:42

Copy link

flaix commented Dec 17, 2016

Looks like a duplicate of issue #837

@flaix flaix modified the milestone: 1.9.0 Jan 18, 2017
@flaix flaix closed this as completed in d52dfc2 Jun 10, 2019
@flaix flaix added Status-Fixed Status-Obsolete Issue has been obsoleted by code changes or become irrelevant or stale and removed Status-New labels Jun 10, 2019
@flaix flaix removed the Status-Obsolete Issue has been obsoleted by code changes or become irrelevant or stale label Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants