From 8b5730a0e32d5707b6ac6df5fb0906b7981853eb Mon Sep 17 00:00:00 2001 From: Florian Zschocke Date: Tue, 20 Aug 2013 21:20:17 +0200 Subject: Fix setting wrrong custom mode on file and in config. --- src/main/java/com/gitblit/utils/JGitUtils.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main/java/com/gitblit/utils/JGitUtils.java') diff --git a/src/main/java/com/gitblit/utils/JGitUtils.java b/src/main/java/com/gitblit/utils/JGitUtils.java index 57bb147f..66dbd60d 100644 --- a/src/main/java/com/gitblit/utils/JGitUtils.java +++ b/src/main/java/com/gitblit/utils/JGitUtils.java @@ -353,7 +353,10 @@ public class JGitUtils { } String getValue() { - if ( enumValue == GitConfigSharedRepositoryValue.Oxxx ) return Integer.toOctalString(intValue); + if ( enumValue == GitConfigSharedRepositoryValue.Oxxx ) { + if (intValue == 0) return "0"; + return String.format("0%o", intValue); + } return enumValue.getConfigValue(); } @@ -410,7 +413,7 @@ public class JGitUtils { if (configShared.isCustom()) { // Use the custom value for access permissions. - mode |= (mode & ~0777) | perm; + mode = (mode & ~0777) | perm; } else { // Just add necessary bits to existing permissions. -- cgit v1.2.3