]> source.dussan.org Git - gitblit.git/commitdiff
[findbugs] Fix user assignment for clone permission check in repository resolver
authorJames Moger <james.moger@gitblit.com>
Fri, 18 Apr 2014 02:15:21 +0000 (22:15 -0400)
committerJames Moger <james.moger@gitblit.com>
Fri, 18 Apr 2014 03:08:07 +0000 (23:08 -0400)
src/main/java/com/gitblit/git/RepositoryResolver.java

index cc13144ec1c5520660fd6cf58ccf6982c43e4b98..103363732bc76e12c1ef59cad00180d6f5803d30 100644 (file)
@@ -83,8 +83,8 @@ public class RepositoryResolver<X> extends FileResolver<X> {
        protected boolean isExportOk(X req, String repositoryName, Repository db) throws IOException {
                RepositoryModel model = gitblit.getRepositoryModel(repositoryName);
 
+               UserModel user = UserModel.ANONYMOUS;
                String scheme = null;
-               UserModel user = null;
                String origin = null;
 
                if (req instanceof GitDaemonClient) {
@@ -93,7 +93,6 @@ public class RepositoryResolver<X> extends FileResolver<X> {
                        GitDaemonClient client = (GitDaemonClient) req;
                        scheme = "git";
                        origin = client.getRemoteAddress().toString();
-                       user = UserModel.ANONYMOUS;
                } else if (req instanceof HttpServletRequest) {
                        // http/https request
                        HttpServletRequest client = (HttpServletRequest) req;