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

This commit is contained in:
Edwin Kempin
2015-05-21 13:59:44 +00:00
committed by Gerrit Code Review

View File

@@ -2367,9 +2367,12 @@ public class ReceiveCommits {
walk.reset();
walk.sort(RevSort.NONE);
try {
walk.markStart(walk.parseCommit(cmd.getNewId()));
RevObject parsedObject = walk.parseAny(cmd.getNewId());
if (!(parsedObject instanceof RevCommit)) {
return;
}
walk.markStart((RevCommit)parsedObject);
markHeadsAsUninteresting(walk, cmd.getRefName());
Set<ObjectId> existing = changeRefsById().keySet();
for (RevCommit c; (c = walk.next()) != null;) {
if (existing.contains(c)) {