Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatheus Tavares <matheus.bernardino@usp.br>2021-04-08 23:41:22 +0300
committerJunio C Hamano <gitster@pobox.com>2021-04-09 00:18:03 +0300
commit4e9569834936a8c0df8c9afdc0334f1b96b20914 (patch)
tree55b1a4a65a05c37d214ec7a6a35812136ea16182 /t/t3700-add.sh
parenta5828ae6b52137b913b978e16cd2334482eb4c1f (diff)
add: include magic part of pathspec on --refresh error
When `git add --refresh <pathspec>` doesn't find any matches for the given pathspec, it prints an error message using the `match` field of the `struct pathspec_item`. However, this field doesn't contain the magic part of the pathspec. Instead, let's use the `original` field. Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3700-add.sh')
-rwxr-xr-xt/t3700-add.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t3700-add.sh b/t/t3700-add.sh
index b3b122ff97..dd3011430d 100755
--- a/t/t3700-add.sh
+++ b/t/t3700-add.sh
@@ -196,6 +196,12 @@ test_expect_success 'git add --refresh with pathspec' '
grep baz actual
'
+test_expect_success 'git add --refresh correctly reports no match error' "
+ echo \"fatal: pathspec ':(icase)nonexistent' did not match any files\" >expect &&
+ test_must_fail git add --refresh ':(icase)nonexistent' 2>actual &&
+ test_cmp expect actual
+"
+
test_expect_success POSIXPERM,SANITY 'git add should fail atomically upon an unreadable file' '
git reset --hard &&
date >foo1 &&