[JGIT PATCH 8/8] Don't try to pack 0{40} during push of delete and update
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Jul 1, 2008, 03:04 UTC
- Message-ID
- <1214881445-3931-9-git-send-email-spearce@spearce.org>
- In-Reply-To
- <1214881445-3931-8-git-send-email-spearce@spearce.org>
`jgit push origin :refs/heads/die refs/heads/master` tries to pack 0{40} to delete branch "die" while also packing the objects needed to update branch master. Since "die" is being removed we do not want to pack any objects for it, as there is nothing to pack.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org> --- .../jgit/transport/BasePackPushConnection.java | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/BasePackPushConnection.java b/org.spearce.jgit/src/org/spearce/jgit/transport/BasePackPushConnection.java index 7ae3aa7..784a578 100644 --- a/org.spearce.jgit/src/org/spearce/jgit/transport/BasePackPushConnection.java +++ b/org.spearce.jgit/src/org/spearce/jgit/transport/BasePackPushConnection.java @@ -169,8 +169,10 @@ class BasePackPushConnection extends BasePackConnection implements for (final Ref r : getRefs()) remoteObjects.add(r.getObjectId()); - for (final RemoteRefUpdate r : refUpdates.values()) - newObjects.add(r.getNewObjectId()); + for (final RemoteRefUpdate r : refUpdates.values()) { + if (!ObjectId.zeroId().equals(r.getNewObjectId())) + newObjects.add(r.getNewObjectId()); + } writer.preparePack(newObjects, remoteObjects, thinPack, true); writer.writePack(out);
-- 1.5.6.74.g8a5e