Allow to push a tag that points to a non-commit object

This was fixed in 2.11.1 with change I013c75db9 but was then
inadvertently reverted by change If4a2375db which was included
in 2.11.2 and 2.11.3.

Redo the original fix.

Bug: Issue 3328
Change-Id: I85e5e1afc65b1408acd0754f6adbdb6742928aaf
This commit is contained in:
David Pursehouse
2015-09-09 09:37:54 +09:00
parent 5eb53d7ffd
commit 318953fdcd

View File

@@ -2382,7 +2382,11 @@ public class ReceiveCommits {
walk.sort(RevSort.NONE);
try {
Set<ObjectId> existing = Sets.newHashSet();
walk.markStart(walk.parseCommit(cmd.getNewId()));
RevObject parsedObject = walk.parseAny(cmd.getNewId());
if (!(parsedObject instanceof RevCommit)) {
return;
}
walk.markStart((RevCommit)parsedObject);
markHeadsAsUninteresting(walk, existing, cmd.getRefName());
RevCommit c;