diff options
author | Florian Zschocke <florian.zschocke@cycos.com> | 2013-08-20 21:20:17 +0200 |
---|---|---|
committer | Florian Zschocke <florian.zschocke@cycos.com> | 2013-08-26 12:39:57 +0200 |
commit | 8b5730a0e32d5707b6ac6df5fb0906b7981853eb (patch) | |
tree | 84f5fbbaaa89d3084ae368c0c99b2a2ed2805c84 /src/main/java/com/gitblit/utils/JGitUtils.java | |
parent | 9d83a080fc0c24770a079c02b83b8141ddbb6534 (diff) | |
download | gitblit-8b5730a0e32d5707b6ac6df5fb0906b7981853eb.tar.gz gitblit-8b5730a0e32d5707b6ac6df5fb0906b7981853eb.zip |
Fix setting wrrong custom mode on file and in config.
Diffstat (limited to 'src/main/java/com/gitblit/utils/JGitUtils.java')
-rw-r--r-- | src/main/java/com/gitblit/utils/JGitUtils.java | 7 |
1 files changed, 5 insertions, 2 deletions
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.
|