Browse Source

Merge "Don't auto follow non-annotated tags in fetch"

stable-0.12
Shawn O. Pearce 14 years ago committed by Code Review
parent
commit
2a137d8dea
  1. 20
      org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java

20
org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java

@ -164,8 +164,10 @@ class FetchProcess {
have.addAll(askFor.keySet()); have.addAll(askFor.keySet());
askFor.clear(); askFor.clear();
for (final Ref r : additionalTags) { for (final Ref r : additionalTags) {
final ObjectId id = r.getPeeledObjectId(); ObjectId id = r.getPeeledObjectId();
if (id == null || transport.local.hasObject(id)) if (id == null)
id = r.getObjectId();
if (transport.local.hasObject(id))
wantTag(r); wantTag(r);
} }
@ -347,14 +349,22 @@ class FetchProcess {
for (final Ref r : conn.getRefs()) { for (final Ref r : conn.getRefs()) {
if (!isTag(r)) if (!isTag(r))
continue; continue;
Ref local = haveRefs.get(r.getName());
ObjectId obj = r.getObjectId();
if (r.getPeeledObjectId() == null) { if (r.getPeeledObjectId() == null) {
additionalTags.add(r); if (local != null && obj.equals(local.getObjectId()))
continue;
if (askFor.containsKey(obj) || transport.local.hasObject(obj))
wantTag(r);
else
additionalTags.add(r);
continue; continue;
} }
final Ref local = haveRefs.get(r.getName());
if (local != null) { if (local != null) {
if (!r.getObjectId().equals(local.getObjectId())) if (!obj.equals(local.getObjectId()))
wantTag(r); wantTag(r);
} else if (askFor.containsKey(r.getPeeledObjectId()) } else if (askFor.containsKey(r.getPeeledObjectId())
|| transport.local.hasObject(r.getPeeledObjectId())) || transport.local.hasObject(r.getPeeledObjectId()))

Loading…
Cancel
Save