Continue traversal when rev-list --unpacked finds a packed commit.
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>
Jan Harkes committed
Oct 30, 2006 at 20:37 UTC
744f498522d2255cf0ce967298c3d87b4727d1a4
1 file changed
+6
-8
revision.c
+6
-8
@@ -418,9 +418,6 @@ static void limit_list(struct rev_info *revs)
418
419
if (revs->max_age != -1 && (commit->date < revs->max_age))
420
obj->flags |= UNINTERESTING;
421
- if (revs->unpacked &&
422
- has_sha1_pack(obj->sha1, revs->ignore_packed))
423
- obj->flags |= UNINTERESTING;
421
add_parents_to_list(revs, commit, &list);
422
if (obj->flags & UNINTERESTING) {
423
mark_parents_uninteresting(commit);
@@ -1142,17 +1139,18 @@ struct commit *get_revision(struct rev_info *revs)
1139
* that we'd otherwise have done in limit_list().
1140
*/
1141
if (!revs->limited) {
1145
- if ((revs->unpacked &&
1146
- has_sha1_pack(commit->object.sha1,
1147
- revs->ignore_packed)) ||
1148
- (revs->max_age != -1 &&
1149
- (commit->date < revs->max_age)))
1142
+ if (revs->max_age != -1 &&
1143
+ (commit->date < revs->max_age))
1144
continue;
1145
add_parents_to_list(revs, commit, &revs->commits);
1146
}
1147
if (commit->object.flags & SHOWN)
1148
continue;
1149
1150
+ if (revs->unpacked && has_sha1_pack(commit->object.sha1,
1151
+ revs->ignore_packed))
1152
+ continue;
1153
+
1154
/* We want to show boundary commits only when their
1155
* children are shown. When path-limiter is in effect,
1156
* rewrite_parents() drops some commits from getting shown,