static int reset_index_and_workdir(
git_repository *repo,
git_commit *commit,
- bool remove_untracked)
+ bool remove_untracked,
+ bool remove_ignored)
{
git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
if (remove_untracked)
opts.checkout_strategy |= GIT_CHECKOUT_REMOVE_UNTRACKED;
+ if (remove_ignored)
+ opts.checkout_strategy |= GIT_CHECKOUT_REMOVE_IGNORED;
+
return git_checkout_tree(repo, (git_object *)commit, &opts);
}
if ((error = reset_index_and_workdir(
repo,
((flags & GIT_STASH_KEEP_INDEX) != 0) ? i_commit : b_commit,
- (flags & GIT_STASH_INCLUDE_UNTRACKED) != 0)) < 0)
+ (flags & GIT_STASH_INCLUDE_UNTRACKED) != 0,
+ (flags & GIT_STASH_INCLUDE_IGNORED) != 0)) < 0)
goto cleanup;
cleanup:
assert_blob_oid("refs/stash^3:who", NULL);
assert_blob_oid("refs/stash^3:when", "b6ed15e81e2593d7bb6265eb4a991d29dc3e628b");
assert_blob_oid("refs/stash^3:just.ignore", "78925fb1236b98b37a35e9723033e627f97aa88b");
+
+ cl_assert(!git_path_exists("stash/just.ignore"));
}
#define MESSAGE "Look Ma! I'm on TV!"