Update JGit to 0.8.4.312-g6517a7c
This resolves an incorrect data corruption error when packing objects for transport that are delta encoded. Change-Id: Ic501a46e31595dd08bccf9469c0b139671b9dc12 Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@@ -56,7 +56,7 @@ import org.eclipse.jgit.errors.IncorrectObjectTypeException;
|
||||
import org.eclipse.jgit.errors.MissingObjectException;
|
||||
import org.eclipse.jgit.errors.RepositoryNotFoundException;
|
||||
import org.eclipse.jgit.lib.AnyObjectId;
|
||||
import org.eclipse.jgit.lib.Commit;
|
||||
import org.eclipse.jgit.lib.CommitBuilder;
|
||||
import org.eclipse.jgit.lib.Constants;
|
||||
import org.eclipse.jgit.lib.ObjectId;
|
||||
import org.eclipse.jgit.lib.ObjectInserter;
|
||||
@@ -552,9 +552,9 @@ public class MergeOp {
|
||||
authorIdent = myIdent;
|
||||
}
|
||||
|
||||
final Commit mergeCommit = new Commit(db);
|
||||
final CommitBuilder mergeCommit = new CommitBuilder();
|
||||
mergeCommit.setTreeId(m.getResultTreeId());
|
||||
mergeCommit.setParentIds(new ObjectId[] {mergeTip, n});
|
||||
mergeCommit.setParentIds(mergeTip, n);
|
||||
mergeCommit.setAuthor(authorIdent);
|
||||
mergeCommit.setCommitter(myIdent);
|
||||
mergeCommit.setMessage(msgbuf.toString());
|
||||
@@ -793,9 +793,9 @@ public class MergeOp {
|
||||
log.error("Can't read approval records for " + n.patchsetId, e);
|
||||
}
|
||||
|
||||
final Commit mergeCommit = new Commit(db);
|
||||
final CommitBuilder mergeCommit = new CommitBuilder();
|
||||
mergeCommit.setTreeId(m.getResultTreeId());
|
||||
mergeCommit.setParentIds(new ObjectId[] {mergeTip});
|
||||
mergeCommit.setParentId(mergeTip);
|
||||
mergeCommit.setAuthor(n.getAuthorIdent());
|
||||
mergeCommit.setCommitter(toCommitterIdent(submitAudit));
|
||||
mergeCommit.setMessage(msgbuf.toString());
|
||||
@@ -810,11 +810,11 @@ public class MergeOp {
|
||||
setRefLogIdent(submitAudit);
|
||||
}
|
||||
|
||||
private ObjectId commit(final Merger m, final Commit mergeCommit)
|
||||
private ObjectId commit(final Merger m, final CommitBuilder mergeCommit)
|
||||
throws IOException, UnsupportedEncodingException {
|
||||
ObjectInserter oi = m.getObjectInserter();
|
||||
try {
|
||||
ObjectId id = oi.insert(Constants.OBJ_COMMIT, oi.format(mergeCommit));
|
||||
ObjectId id = oi.insert(mergeCommit);
|
||||
oi.flush();
|
||||
return id;
|
||||
} finally {
|
||||
|
||||
@@ -57,8 +57,10 @@ import com.google.inject.assistedinject.Assisted;
|
||||
|
||||
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
|
||||
import org.eclipse.jgit.errors.MissingObjectException;
|
||||
import org.eclipse.jgit.lib.AbbreviatedObjectId;
|
||||
import org.eclipse.jgit.lib.Constants;
|
||||
import org.eclipse.jgit.lib.ObjectId;
|
||||
import org.eclipse.jgit.lib.ObjectReader;
|
||||
import org.eclipse.jgit.lib.PersonIdent;
|
||||
import org.eclipse.jgit.lib.Ref;
|
||||
import org.eclipse.jgit.lib.RefUpdate;
|
||||
@@ -1067,7 +1069,8 @@ public class ReceiveCommits implements PreReceiveHook, PostReceiveHook {
|
||||
reject(request.cmd, "no changes made");
|
||||
return null;
|
||||
} else {
|
||||
rp.sendMessage("(W) " + c.abbreviate(repo, 6).name() + ":" //
|
||||
ObjectReader reader = rp.getRevWalk().getObjectReader();
|
||||
rp.sendMessage("(W) " + reader.abbreviate(c).name() + ":" //
|
||||
+ " no files changed, but" //
|
||||
+ (!messageEq ? " message updated" : "") //
|
||||
+ (!messageEq && !parentsEq ? " and" : "") //
|
||||
@@ -1405,8 +1408,15 @@ public class ReceiveCommits implements PreReceiveHook, PostReceiveHook {
|
||||
}
|
||||
|
||||
private void warnMalformedMessage(RevCommit c) {
|
||||
ObjectReader reader = rp.getRevWalk().getObjectReader();
|
||||
if (65 < c.getShortMessage().length()) {
|
||||
rp.sendMessage("(W) " + c.abbreviate(repo, 6).name()
|
||||
AbbreviatedObjectId id;
|
||||
try {
|
||||
id = reader.abbreviate(c);
|
||||
} catch (IOException err) {
|
||||
id = c.abbreviate(6);
|
||||
}
|
||||
rp.sendMessage("(W) " + id.name() //
|
||||
+ ": commit subject >65 characters; use shorter first paragraph");
|
||||
}
|
||||
|
||||
@@ -1421,7 +1431,13 @@ public class ReceiveCommits implements PreReceiveHook, PostReceiveHook {
|
||||
}
|
||||
|
||||
if (0 < longLineCnt && 33 < longLineCnt * 100 / nonEmptyCnt) {
|
||||
rp.sendMessage("(W) " + c.abbreviate(repo, 6).name()
|
||||
AbbreviatedObjectId id;
|
||||
try {
|
||||
id = reader.abbreviate(c);
|
||||
} catch (IOException err) {
|
||||
id = c.abbreviate(6);
|
||||
}
|
||||
rp.sendMessage("(W) " + id.name() //
|
||||
+ ": commit message lines >70 characters; manually wrap lines");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class Text extends RawText {
|
||||
RevCommit p = c.getParent(0);
|
||||
rw.parseBody(p);
|
||||
b.append("Parent: ");
|
||||
b.append(p.abbreviate(db, 8).name());
|
||||
b.append(reader.abbreviate(p, 8).name());
|
||||
b.append(" (");
|
||||
b.append(p.getShortMessage());
|
||||
b.append(")\n");
|
||||
@@ -74,7 +74,7 @@ public class Text extends RawText {
|
||||
RevCommit p = c.getParent(i);
|
||||
rw.parseBody(p);
|
||||
b.append(i == 0 ? "Merge Of: " : " ");
|
||||
b.append(p.abbreviate(db, 8).name());
|
||||
b.append(reader.abbreviate(p, 8).name());
|
||||
b.append(" (");
|
||||
b.append(p.getShortMessage());
|
||||
b.append(")\n");
|
||||
|
||||
@@ -19,7 +19,7 @@ import com.google.gerrit.server.util.HostPlatform;
|
||||
import org.eclipse.jgit.dircache.DirCache;
|
||||
import org.eclipse.jgit.dircache.DirCacheBuilder;
|
||||
import org.eclipse.jgit.dircache.DirCacheEntry;
|
||||
import org.eclipse.jgit.lib.Commit;
|
||||
import org.eclipse.jgit.lib.CommitBuilder;
|
||||
import org.eclipse.jgit.lib.Constants;
|
||||
import org.eclipse.jgit.lib.FileMode;
|
||||
import org.eclipse.jgit.lib.ObjectId;
|
||||
@@ -401,12 +401,12 @@ public class CommitMsgHookTest extends HookTestCase {
|
||||
private void setHEAD() throws Exception {
|
||||
final ObjectInserter oi = repository.newObjectInserter();
|
||||
try {
|
||||
final Commit commit = new Commit(repository);
|
||||
commit.setTreeId(DirCache.newInCore().writeTree(oi));
|
||||
final CommitBuilder commit = new CommitBuilder();
|
||||
commit.setTreeId(oi.insert(Constants.OBJ_TREE, new byte[] {}));
|
||||
commit.setAuthor(author);
|
||||
commit.setCommitter(committer);
|
||||
commit.setMessage("test\n");
|
||||
ObjectId commitId = oi.insert(Constants.OBJ_COMMIT, oi.format(commit));
|
||||
ObjectId commitId = oi.insert(commit);
|
||||
|
||||
final RefUpdate ref = repository.updateRef(Constants.HEAD);
|
||||
ref.setNewObjectId(commitId);
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -46,7 +46,7 @@ limitations under the License.
|
||||
</issueManagement>
|
||||
|
||||
<properties>
|
||||
<jgitVersion>0.8.4.242-g09130b8</jgitVersion>
|
||||
<jgitVersion>0.8.4.312-g6517a7c</jgitVersion>
|
||||
<gwtormVersion>1.1.4</gwtormVersion>
|
||||
<gwtjsonrpcVersion>1.2.2</gwtjsonrpcVersion>
|
||||
<gwtexpuiVersion>1.2.2</gwtexpuiVersion>
|
||||
|
||||
Reference in New Issue
Block a user