summaryrefslogtreecommitdiff
path: root/tests-clar/stash/drop.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests-clar/stash/drop.c')
-rw-r--r--tests-clar/stash/drop.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/tests-clar/stash/drop.c b/tests-clar/stash/drop.c
index 60b3c72e0..59413f01e 100644
--- a/tests-clar/stash/drop.c
+++ b/tests-clar/stash/drop.c
@@ -36,25 +36,27 @@ static void push_three_states(void)
cl_git_mkfile("stash/zero.txt", "content\n");
cl_git_pass(git_repository_index(&index, repo));
cl_git_pass(git_index_add_bypath(index, "zero.txt"));
- commit_staged_files(&oid, index, signature);
+ cl_repo_commit_from_index(NULL, repo, signature, 0, "Initial commit");
cl_assert(git_path_exists("stash/zero.txt"));
+ git_index_free(index);
cl_git_mkfile("stash/one.txt", "content\n");
- cl_git_pass(git_stash_save(&oid, repo, signature, "First", GIT_STASH_INCLUDE_UNTRACKED));
+ cl_git_pass(git_stash_save(
+ &oid, repo, signature, "First", GIT_STASH_INCLUDE_UNTRACKED));
cl_assert(!git_path_exists("stash/one.txt"));
cl_assert(git_path_exists("stash/zero.txt"));
cl_git_mkfile("stash/two.txt", "content\n");
- cl_git_pass(git_stash_save(&oid, repo, signature, "Second", GIT_STASH_INCLUDE_UNTRACKED));
+ cl_git_pass(git_stash_save(
+ &oid, repo, signature, "Second", GIT_STASH_INCLUDE_UNTRACKED));
cl_assert(!git_path_exists("stash/two.txt"));
cl_assert(git_path_exists("stash/zero.txt"));
cl_git_mkfile("stash/three.txt", "content\n");
- cl_git_pass(git_stash_save(&oid, repo, signature, "Third", GIT_STASH_INCLUDE_UNTRACKED));
+ cl_git_pass(git_stash_save(
+ &oid, repo, signature, "Third", GIT_STASH_INCLUDE_UNTRACKED));
cl_assert(!git_path_exists("stash/three.txt"));
cl_assert(git_path_exists("stash/zero.txt"));
-
- git_index_free(index);
}
void test_stash_drop__cannot_drop_a_non_existing_stashed_state(void)
@@ -160,7 +162,7 @@ void test_stash_drop__dropping_the_top_stash_updates_the_stash_reference(void)
retrieve_top_stash_id(&oid);
cl_git_pass(git_revparse_single(&next_top_stash, repo, "stash@{1}"));
- cl_assert_equal_i(false, git_oid_cmp(&oid, git_object_id(next_top_stash)) == 0);
+ cl_assert(git_oid_cmp(&oid, git_object_id(next_top_stash)) != 0);
cl_git_pass(git_stash_drop(repo, 0));