if (revs->max_age != -1 && (commit->date < revs->max_age))
obj->flags |= UNINTERESTING;
- if (revs->unpacked && has_sha1_pack(obj->sha1))
+ 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) {
return 0;
}
+static void add_ignore_packed(struct rev_info *revs, const char *name)
+{
+ int num = ++revs->num_ignore_packed;
+
+ revs->ignore_packed = xrealloc(revs->ignore_packed,
+ sizeof(const char **) * (num + 1));
+ revs->ignore_packed[num-1] = name;
+ revs->ignore_packed[num] = NULL;
+}
+
/*
* Parse revision information, filling in the "rev_info" structure,
* and removing the used arguments from the argument list.
}
if (!strcmp(arg, "--unpacked")) {
revs->unpacked = 1;
+ free(revs->ignore_packed);
+ revs->ignore_packed = NULL;
+ revs->num_ignore_packed = 0;
+ continue;
+ }
+ if (!strncmp(arg, "--unpacked=", 11)) {
+ revs->unpacked = 1;
+ add_ignore_packed(revs, arg+11);
continue;
}
if (!strcmp(arg, "-r")) {
*/
if (!revs->limited) {
if ((revs->unpacked &&
- has_sha1_pack(commit->object.sha1)) ||
+ has_sha1_pack(commit->object.sha1,
+ revs->ignore_packed)) ||
(revs->max_age != -1 &&
(commit->date < revs->max_age)))
continue;