diff --git a/docu/index.md b/docu/index.md index b0080c62..2666c918 100644 --- a/docu/index.md +++ b/docu/index.md @@ -5,7 +5,7 @@ with full SSO through Gerrit. * License: [Apache Public License 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [Home page](https://github.com/tomaswolf/gerrit-gitblit-plugin) -* Installed plugin version: 3.1.171.0-SNAPSHOT +* Installed plugin version: 3.2.171.0-SNAPSHOT For a list of contributors, see at [GitHub](https://github.com/tomaswolf/gerrit-gitblit-plugin/graphs/contributors). @@ -92,6 +92,6 @@ Report bugs or make feature requests at the [GitHub issue tracker](https://githu
-GitBlit plugin 3.1.171.0-SNAPSHOT +GitBlit plugin 3.2.171.0-SNAPSHOT
diff --git a/pom.xml b/pom.xml index 609a375e..4f75380e 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ limitations under the License. gitblit-plugin GitBlit for Gerrit integrated as a plugin Gerrit - GitBlit Plugin - 3.1.171.0-SNAPSHOT + 3.2.171.0-SNAPSHOT Apache License 2.0 @@ -29,8 +29,8 @@ limitations under the License. plugin - 3.1.0 - 5.5.1.201910021850-r + 3.2.0 + 5.8.0.202006091008-r 1.7.1 1.4.22 6.6.5 diff --git a/src/main/java/com/gitblit/utils/JGitUtils.java b/src/main/java/com/gitblit/utils/JGitUtils.java index 4b1ab6fe..8c8c9999 100644 --- a/src/main/java/com/gitblit/utils/JGitUtils.java +++ b/src/main/java/com/gitblit/utils/JGitUtils.java @@ -17,6 +17,7 @@ import java.io.File; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.nio.file.FileVisitResult; import java.nio.file.Files; import java.nio.file.Path; @@ -2169,7 +2170,7 @@ public static boolean createOrphanBranch(Repository repository, String branchNam } try (ObjectInserter odi = repository.newObjectInserter()) { // Create a blob object to insert into a tree - ObjectId blobId = odi.insert(Constants.OBJ_BLOB, message.getBytes(Constants.CHARACTER_ENCODING)); + ObjectId blobId = odi.insert(Constants.OBJ_BLOB, message.getBytes(StandardCharsets.UTF_8)); // Create a tree object to reference from a commit TreeFormatter tree = new TreeFormatter(); @@ -2180,7 +2181,7 @@ public static boolean createOrphanBranch(Repository repository, String branchNam CommitBuilder commit = new CommitBuilder(); commit.setAuthor(author); commit.setCommitter(author); - commit.setEncoding(Constants.CHARACTER_ENCODING); + commit.setEncoding(StandardCharsets.UTF_8); commit.setMessage(message); commit.setTreeId(treeId); @@ -2435,7 +2436,7 @@ public static MergeResult merge(Repository repository, String src, String toBran CommitBuilder commitBuilder = new CommitBuilder(); commitBuilder.setCommitter(committer); commitBuilder.setAuthor(committer); - commitBuilder.setEncoding(Constants.CHARSET); + commitBuilder.setEncoding(StandardCharsets.UTF_8); if (StringUtils.isEmpty(message)) { message = MessageFormat.format("merge {0} into {1}", srcTip.getName(), branchTip.getName()); } diff --git a/src/main/java/com/gitblit/utils/RefLogUtils.java b/src/main/java/com/gitblit/utils/RefLogUtils.java index bd710e5b..2c8c9c1b 100644 --- a/src/main/java/com/gitblit/utils/RefLogUtils.java +++ b/src/main/java/com/gitblit/utils/RefLogUtils.java @@ -16,9 +16,11 @@ package com.gitblit.utils; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.text.DateFormat; import java.text.MessageFormat; import java.text.SimpleDateFormat; +import java.time.Instant; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -255,7 +257,7 @@ public static boolean updateRefLog(UserModel user, Repository repository, Collec CommitBuilder commit = new CommitBuilder(); commit.setAuthor(ident); commit.setCommitter(ident); - commit.setEncoding(Constants.ENCODING); + commit.setEncoding(StandardCharsets.UTF_8); commit.setMessage(message); commit.setParentId(headId); commit.setTreeId(indexTreeId); @@ -305,7 +307,7 @@ private static DirCache createIndex(Repository repo, ObjectId headId, Collection DirCache inCoreIndex = DirCache.newInCore(); DirCacheBuilder dcBuilder = inCoreIndex.builder(); - long now = System.currentTimeMillis(); + Instant now = Instant.now(); Set ignorePaths = new TreeSet(); try (ObjectInserter inserter = repo.newObjectInserter()) { // add receive commands to the temporary index @@ -345,7 +347,7 @@ private static DirCache createIndex(Repository repo, ObjectId headId, Collection dcEntry.setFileMode(FileMode.REGULAR_FILE); // insert object - dcEntry.setObjectId(inserter.insert(org.eclipse.jgit.lib.Constants.OBJ_BLOB, content.getBytes("UTF-8"))); + dcEntry.setObjectId(inserter.insert(org.eclipse.jgit.lib.Constants.OBJ_BLOB, content.getBytes(StandardCharsets.UTF_8))); // add to temporary in-core index dcBuilder.add(dcEntry);