mirror of
https://github.com/git-for-windows/git.git
synced 2026-03-18 07:33:26 -05:00
fixup! stash: fix segmentation fault when files were added with intent
In preparation for a newer patch series. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -1050,8 +1050,6 @@ static int stash_working_tree(struct stash_info *info, struct pathspec ps)
|
||||
struct strbuf diff_output = STRBUF_INIT;
|
||||
struct index_state istate = { NULL };
|
||||
|
||||
init_revisions(&rev, NULL);
|
||||
|
||||
set_alternate_index_output(stash_index_path.buf);
|
||||
if (reset_tree(&info->i_tree, 0, 0)) {
|
||||
ret = -1;
|
||||
@@ -1059,6 +1057,7 @@ static int stash_working_tree(struct stash_info *info, struct pathspec ps)
|
||||
}
|
||||
set_alternate_index_output(NULL);
|
||||
|
||||
init_revisions(&rev, NULL);
|
||||
rev.prune_data = ps;
|
||||
rev.diffopt.output_format = DIFF_FORMAT_CALLBACK;
|
||||
rev.diffopt.format_callback = add_diff_to_buf;
|
||||
|
||||
@@ -287,14 +287,6 @@ test_expect_success 'stash an added file' '
|
||||
test new = "$(cat file3)"
|
||||
'
|
||||
|
||||
test_expect_success 'stash --intent-to-add file' '
|
||||
git reset --hard &&
|
||||
echo new >file4 &&
|
||||
git add --intent-to-add file4 &&
|
||||
test_when_finished "git rm -f file4" &&
|
||||
test_must_fail git stash
|
||||
'
|
||||
|
||||
test_expect_success 'stash rm then recreate' '
|
||||
git reset --hard &&
|
||||
git rm file &&
|
||||
|
||||
Reference in New Issue
Block a user