diff options
Diffstat (limited to 'org.eclipse.jgit/src')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java index def6033b8b..e367ab44c9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java @@ -283,8 +283,12 @@ public abstract class BasePackPushConnection extends BasePackConnection implemen local.newObjectReader()); try { - for (final Ref r : getRefs()) - remoteObjects.add(r.getObjectId()); + for (final Ref r : getRefs()) { + // only add objects that we actually have + ObjectId oid = r.getObjectId(); + if (local.hasObject(oid)) + remoteObjects.add(oid); + } remoteObjects.addAll(additionalHaves); for (final RemoteRefUpdate r : refUpdates.values()) { if (!ObjectId.zeroId().equals(r.getNewObjectId())) |