summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/GitBlit.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2013-09-23 09:51:45 -0400
committerJames Moger <james.moger@gitblit.com>2013-09-23 09:51:45 -0400
commit288d6cc169706607601f185505fca50f9950c30b (patch)
tree6d7e50d39d5e6c52222e1abed7d89bb808e9645a /src/main/java/com/gitblit/GitBlit.java
parent2a8ea034b63736708839c140e53121026c19b9a8 (diff)
downloadgitblit-288d6cc169706607601f185505fca50f9950c30b.tar.gz
gitblit-288d6cc169706607601f185505fca50f9950c30b.zip
Fix potential NPE in setting shared permissions
Diffstat (limited to 'src/main/java/com/gitblit/GitBlit.java')
-rw-r--r--src/main/java/com/gitblit/GitBlit.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/com/gitblit/GitBlit.java b/src/main/java/com/gitblit/GitBlit.java
index 95da669e..2cebe82b 100644
--- a/src/main/java/com/gitblit/GitBlit.java
+++ b/src/main/java/com/gitblit/GitBlit.java
@@ -2534,16 +2534,16 @@ public class GitBlit implements ServletContextListener {
}
}
+ // Adjust permissions in case we updated the config files
+ JGitUtils.adjustSharedPerm(new File(r.getDirectory().getAbsolutePath(), "config"),
+ getString(Keys.git.createRepositoriesShared, "FALSE"));
+ JGitUtils.adjustSharedPerm(new File(r.getDirectory().getAbsolutePath(), "HEAD"),
+ getString(Keys.git.createRepositoriesShared, "FALSE"));
+
// close the repository object
r.close();
}
- // Adjust permissions in case we updated the config files
- JGitUtils.adjustSharedPerm(new File(r.getDirectory().getAbsolutePath(), "config"),
- getString(Keys.git.createRepositoriesShared, "FALSE"));
- JGitUtils.adjustSharedPerm(new File(r.getDirectory().getAbsolutePath(), "HEAD"),
- getString(Keys.git.createRepositoriesShared, "FALSE"));
-
// update repository cache
removeFromCachedRepositoryList(repositoryName);
// model will actually be replaced on next load because config is stale