[JGIT PATCH 8/8] Don't try to pack 0{40} during push of delete and update

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



`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@xxxxxxxxxxx>
---
 .../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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux