Skip to content

Commit 5779b92

Browse files
committed
merge interrupted when discarding all ignored
1 parent f06ba5f commit 5779b92

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

merge-overlay

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ while IFS= read -u 4 -r -d '' file; do
353353
# Auto-discard ignored files
354354
rm -f "$file"
355355
elif git_ignored_should_discard "$rel_path"; then
356+
((++GIT_IGNORED_COUNT)) # pre-increment to avoid returning non-zero status
356357
rm -f "$file"
357-
((GIT_IGNORED_COUNT++))
358358
else
359359
FILES+=("$rel_path")
360360
fi

tests/test-merge-overlay.expect

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ proc test_git_ignored_discard_all {} {
633633
-re {Git-ignored file detected:} {
634634
expect {
635635
-re {How should git-ignored files be handled.*\?} {
636-
send "D\r"
636+
send "R\r"
637637
expect {
638638
"→ All git-ignored files will be discarded" {
639639
# Should see "Discarded N git-ignored file(s)"
@@ -860,7 +860,7 @@ proc test_git_ignored_invalid_input {} {
860860
# Now send valid input
861861
expect {
862862
-re {How should git-ignored files be handled.*\?} {
863-
send "D\r"
863+
send "R\r"
864864
expect {
865865
"→ All git-ignored files will be discarded" {
866866
expect eof

0 commit comments

Comments
 (0)