Commits

Anonymous committed f8f9c73

describe: allow more than one revs to be named.

The main loop was prepared to take more than one revs, but the actual
naming logic wad not (it used pop_most_recent_commit while forgetting
that the commit marks stay after it's done).

Signed-off-by: Junio C Hamano <junkio@cox.net>

  • Participants
  • Parent commits 78c2cff

Comments (0)

Files changed (3)

 	return ret;
 }
 
+void clear_commit_marks(struct commit *commit, unsigned int mark)
+{
+	struct commit_list *parents;
+
+	parents = commit->parents;
+	commit->object.flags &= ~mark;
+	while (parents) {
+		if (parents->item && parents->item->object.parsed)
+			clear_commit_marks(parents->item, mark);
+		parents = parents->next;
+	}
+}
+
 /*
  * Generic support for pretty-printing the header
  */
 
 struct commit *pop_commit(struct commit_list **stack);
 
+void clear_commit_marks(struct commit *commit, unsigned int mark);
+
 int count_parents(struct commit * commit);
 
 /*
 		if (n) {
 			printf("%s-g%s\n", n->path,
 			       find_unique_abbrev(cmit->object.sha1, abbrev));
-			return;
+			break;
 		}
 	}
+	clear_commit_marks(cmit, SEEN);
 }
 
 int main(int argc, char **argv)