summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/revision.c b/revision.c
index 5d137ea14a..2d27ccf70b 100644
--- a/revision.c
+++ b/revision.c
@@ -1285,17 +1285,21 @@ struct commit *get_revision(struct rev_info *revs)
commit_list_insert(c, &l);
revs->commits = l;
revs->reverse = 0;
+ c = NULL;
}
/*
* Now pick up what they want to give us
*/
- c = get_revision_1(revs);
+ if (!(c = get_revision_1(revs)))
+ return NULL;
while (0 < revs->skip_count) {
revs->skip_count--;
c = get_revision_1(revs);
if (!c)
break;
+ /* Although we grabbed it, it is not shown. */
+ c->object.flags &= ~SHOWN;
}
/*
@@ -1305,6 +1309,9 @@ struct commit *get_revision(struct rev_info *revs)
case -1:
break;
case 0:
+ /* Although we grabbed it, it is not shown. */
+ if (c)
+ c->object.flags &= ~SHOWN;
c = NULL;
break;
default: