Commit 5a503fff by Carlos Martín Nieto

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.
parent 47f37400
......@@ -314,6 +314,23 @@ void test_revwalk_basic__disallow_non_commit(void)
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)
{
revwalk_basic_setup_walk(NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment