Skip to content

Commit

Permalink
Continue traversal when rev-list --unpacked finds a packed commit.
Browse files Browse the repository at this point in the history
When getting the list of all unpacked objects by walking the commit history,
we would stop traversal whenever we hit a packed commit. However the fact
that we found a packed commit does not guarantee that all previous commits
are also packed. As a result the commit walkers did not show all reachable
unpacked objects.

Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Jan Harkes authored and Junio C Hamano committed Oct 31, 2006
1 parent 173a9cb commit 744f498
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions revision.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,6 @@ static void limit_list(struct rev_info *revs)

if (revs->max_age != -1 && (commit->date < revs->max_age))
obj->flags |= UNINTERESTING;
if (revs->unpacked &&
has_sha1_pack(obj->sha1, revs->ignore_packed))
obj->flags |= UNINTERESTING;
add_parents_to_list(revs, commit, &list);
if (obj->flags & UNINTERESTING) {
mark_parents_uninteresting(commit);
Expand Down Expand Up @@ -1142,17 +1139,18 @@ struct commit *get_revision(struct rev_info *revs)
* that we'd otherwise have done in limit_list().
*/
if (!revs->limited) {
if ((revs->unpacked &&
has_sha1_pack(commit->object.sha1,
revs->ignore_packed)) ||
(revs->max_age != -1 &&
(commit->date < revs->max_age)))
if (revs->max_age != -1 &&
(commit->date < revs->max_age))
continue;
add_parents_to_list(revs, commit, &revs->commits);
}
if (commit->object.flags & SHOWN)
continue;

if (revs->unpacked && has_sha1_pack(commit->object.sha1,
revs->ignore_packed))
continue;

/* We want to show boundary commits only when their
* children are shown. When path-limiter is in effect,
* rewrite_parents() drops some commits from getting shown,
Expand Down

0 comments on commit 744f498

Please sign in to comment.