Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2015-03-03 18:08:28 +0300
committerEdward Thomson <ethomson@edwardthomson.com>2015-03-03 18:08:28 +0300
commit018fdbb5809469c917eb04c01e929050df30846f (patch)
tree73b832d3e55f66f7db73d2bcab515094a0500815 /tests/stash/save.c
parent72ca65d538d1e3ab7a9052613412bf121470dfd6 (diff)
parent09866d6f84a644c4dff258055c570d619fe7bad7 (diff)
Merge pull request #2913 from ethomson/stash_fixup
stash: correctly stash wd modified/index deleted
Diffstat (limited to 'tests/stash/save.c')
-rw-r--r--tests/stash/save.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/stash/save.c b/tests/stash/save.c
index 78eee4a04..e07877516 100644
--- a/tests/stash/save.c
+++ b/tests/stash/save.c
@@ -399,3 +399,22 @@ void test_stash_save__skip_submodules(void)
assert_status(repo, "untracked_repo/", GIT_STATUS_WT_NEW);
}
+
+void test_stash_save__deleted_in_index_modified_in_workdir(void)
+{
+ git_index *index;
+
+ git_repository_index(&index, repo);
+
+ cl_git_pass(git_index_remove_bypath(index, "who"));
+ cl_git_pass(git_index_write(index));
+
+ assert_status(repo, "who", GIT_STATUS_WT_NEW | GIT_STATUS_INDEX_DELETED);
+
+ cl_git_pass(git_stash_save(&stash_tip_oid, repo, signature, NULL, GIT_STASH_DEFAULT));
+
+ assert_blob_oid("stash@{0}^0:who", "a0400d4954659306a976567af43125a0b1aa8595");
+ assert_blob_oid("stash@{0}^2:who", NULL);
+
+ git_index_free(index);
+}