Skip to content

Commit c274db7

Browse files
committed
Merge branch 'pv/maint-add-p-no-exclude'
* pv/maint-add-p-no-exclude: git-add--interactive: never skip files included in index
2 parents 695f952 + b145b21 commit c274db7

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

git-add--interactive.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ sub list_modified {
259259
@tracked = map {
260260
chomp $_;
261261
unquote_path($_);
262-
} run_cmd_pipe(qw(git ls-files --exclude-standard --), @ARGV);
262+
} run_cmd_pipe(qw(git ls-files --), @ARGV);
263263
return if (!@tracked);
264264
}
265265

t/t3701-add-interactive.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,20 @@ test_expect_success 'real edit works' '
138138
test_cmp expected output
139139
'
140140

141+
test_expect_success 'skip files similarly as commit -a' '
142+
git reset &&
143+
echo file >.gitignore &&
144+
echo changed >file &&
145+
echo y | git add -p file &&
146+
git diff >output &&
147+
git reset &&
148+
git commit -am commit &&
149+
git diff >expected &&
150+
test_cmp expected output &&
151+
git reset --hard HEAD^
152+
'
153+
rm -f .gitignore
154+
141155
if test "$(git config --bool core.filemode)" = false
142156
then
143157
say 'skipping filemode tests (filesystem does not properly support modes)'

0 commit comments

Comments
 (0)