From 8223a7e6463fa530602e6c967343c2536ce9aae6 Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Fri, 7 Jul 2017 14:43:57 -0400 Subject: [PATCH 1/2] Temporarily @Ignore flaky CommitCommandTest methods Change-Id: Ia2c42d014323bd29b85bf76f1a20c83f612406d7 Signed-off-by: David Pursehouse (cherry picked from commit e93b0026ced10c956e76daed038f2560a33b5baf) --- .../tst/org/eclipse/jgit/api/CommitCommandTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java index 8a07118f8..ba8408102 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java @@ -76,6 +76,7 @@ import org.eclipse.jgit.submodule.SubmoduleWalk; import org.eclipse.jgit.treewalk.TreeWalk; import org.eclipse.jgit.treewalk.filter.TreeFilter; import org.eclipse.jgit.util.FS; +import org.junit.Ignore; import org.junit.Test; /** @@ -291,6 +292,7 @@ public class CommitCommandTest extends RepositoryTestCase { } } + @Ignore("very flaky when run with Hudson") @Test public void commitUpdatesSmudgedEntries() throws Exception { try (Git git = new Git(db)) { @@ -347,6 +349,7 @@ public class CommitCommandTest extends RepositoryTestCase { } } + @Ignore("very flaky when run with Hudson") @Test public void commitIgnoresSmudgedEntryWithDifferentId() throws Exception { try (Git git = new Git(db)) { From 7df024b2761d5604ca8a63e0cc2324ce2f477c6f Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Wed, 20 Jun 2018 21:19:11 -0700 Subject: [PATCH 2/2] Respect "unshallow" lines in protocol v2 If I run git config --global protocol.version 2 mkdir repo cd repo git init --bare git remote add origin https://go.googlesource.com/proposal git fetch --depth=1 git fetch --unshallow then I expect to have a full history, just as though I had fetched without --depth in the first place. Instead, it reports success but does not fetch enough objects: $ git fsck notice: HEAD points to an unborn branch (master) Checking object directories: 100% (256/256), done. Checking objects: 100% (468/468), done. broken link from commit 2c6bc83f234085c8eadb7ea33405ce6223c44d1b to commit 878975cf2b600675b4c905e5d9591bd24541ae9e missing commit 878975cf2b600675b4c905e5d9591bd24541ae9e dangling commit 314be00dae78dd526851f5635e6349014e2ad0c2 The false success indicates problems in the client and the server. Git 2.18-rc2 (the client) ought to have been more defensive, noticing the incomplete history. The greater error is in JGit (the server), which neglects to send the objects requested. When serving protocol v0 requests, JGit sends the correct objects by taking unshallowCommits into account when generating the pack to send to the client. Do the same in the protocol v2 code path. I forgot to do this in v5.0.0.201806050710-rc3~6 (Teach UploadPack shallow fetch in protocol v2, 2018-03-15). Reported-by: Russ Cox Change-Id: I282b45f47616a641b9e8d6210b4a070d3efdbb9b Signed-off-by: Jonathan Nieder --- org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java index f70ead929..7de0506bb 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java @@ -1082,7 +1082,7 @@ public class UploadPack { includeTag ? db.getRefDatabase().getRefsByPrefix(R_TAGS) : null, - new ArrayList()); + unshallowCommits); } pckOut.end(); }