Similar to 'git reset -N', this option makes 'git apply' automatically
mark new files as intent-to-add so they are visible in the following
'git diff' command and could also be committed with 'git commit -a'.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Nguyễn Thái Ngọc Duy7 years agocommitted byJunio C Hamano
@ -141,6 +141,8 @@ int check_apply_state(struct apply_state *state, int force_apply)
@@ -141,6 +141,8 @@ int check_apply_state(struct apply_state *state, int force_apply)
return error(_("--cached outside a repository"));
state->check_index = 1;
}
if (state->ita_only && (state->check_index || is_not_gitdir))
@ -245,6 +245,7 @@ test_expect_success 'diff-files/diff-cached shows ita as new/not-new files' '
@@ -245,6 +245,7 @@ test_expect_success 'diff-files/diff-cached shows ita as new/not-new files' '
test_cmp expected2 actual2
'
test_expect_success '"diff HEAD" includes ita as new files' '
git reset --hard &&
echo new >new-ita &&
@ -262,4 +263,16 @@ test_expect_success '"diff HEAD" includes ita as new files' '
@@ -262,4 +263,16 @@ test_expect_success '"diff HEAD" includes ita as new files' '