revwalk: add failing test for hiding and then pushing a commit

When we hide a commit which we later push into the revwalk, we do not
handle this well and return commits which we should not.
This commit is contained in:
Carlos Martín Nieto 2015-04-08 23:42:36 +02:00
parent 47f3740025
commit 5a503fffbc

View File

@ -314,6 +314,23 @@ void test_revwalk_basic__disallow_non_commit(void)
cl_git_fail(git_revwalk_push(_walk, &oid)); cl_git_fail(git_revwalk_push(_walk, &oid));
} }
void test_revwalk_basic__hide_then_push(void)
{
git_oid oid;
int i = 0;
revwalk_basic_setup_walk(NULL);
cl_git_pass(git_oid_fromstr(&oid, "5b5b025afb0b4c913b4c338a42934a3863bf3644"));
cl_git_pass(git_revwalk_hide(_walk, &oid));
cl_git_pass(git_revwalk_push(_walk, &oid));
while (git_revwalk_next(&oid, _walk) == 0)
i++;
cl_assert_equal_i(i, 0);
}
void test_revwalk_basic__push_range(void) void test_revwalk_basic__push_range(void)
{ {
revwalk_basic_setup_walk(NULL); revwalk_basic_setup_walk(NULL);