Thread (15 messages) flat view 15 messages, 5 authors, 2020-01-17
STALE2425d REVIEWED: 1 (0M)

1 review trailer.

[PATCH v3 1/4] clean: demonstrate a bug with pathspecs

From: Derrick Stolee via GitGitGadget <hidden>
Date: 2020-01-16 20:22:05
Subsystem: the rest · Maintainer: Linus Torvalds

From: Derrick Stolee <redacted>

b9670c1f5e (dir: fix checks on common prefix directory, 2019-12-19)
modified the way pathspecs are handled when handling a directory
during "git clean -f <path>". While this improved the behavior for
known test breakages, it also regressed in how the clean command
handles cleaning a specified file.

Add a test case that demonstrates this behavior. This test passes
before b9670c1f5e then fails after.

Helped-by: Kevin Willford [off-list ref]
Signed-off-by: Derrick Stolee <redacted>
Reviewed-by: Elijah Newren <redacted>
---
 t/t7300-clean.sh | 9 +++++++++
 1 file changed, 9 insertions(+)
diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
index 6e6d24c1c3..782e125c89 100755
--- a/t/t7300-clean.sh
+++ b/t/t7300-clean.sh
@@ -737,4 +737,13 @@ test_expect_success MINGW 'handle clean & core.longpaths = false nicely' '
 	test_i18ngrep "too long" .git/err
 '
 
+test_expect_failure 'clean untracked paths by pathspec' '
+	git init untracked &&
+	mkdir untracked/dir &&
+	echo >untracked/dir/file.txt &&
+	git -C untracked clean -f dir/file.txt &&
+	ls untracked/dir >actual &&
+	test_must_be_empty actual
+'
+
 test_done
-- 
gitgitgadget
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help