summaryrefslogtreecommitdiff
path: root/pathspec.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-06-07 21:10:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-06-07 21:10:59 (GMT)
commitf00809500f35ed2dbef9e58ae07ca2b6dcc82776 (patch)
treef1120224b60e02560a900ebf509dd6116d6c89a6 /pathspec.c
parent08baf19fa316b8395bb0d984d66d438d233d2b5c (diff)
parentb02fdbc80a41f73ceb6c99e8e27b22285243a335 (diff)
downloadgit-f00809500f35ed2dbef9e58ae07ca2b6dcc82776.zip
git-f00809500f35ed2dbef9e58ae07ca2b6dcc82776.tar.gz
git-f00809500f35ed2dbef9e58ae07ca2b6dcc82776.tar.bz2
Merge branch 'jc/all-negative-pathspec'
A git subcommand like "git add -p" spawns a separate git process while relaying its command line arguments. A pathspec with only negative elements was mistakenly passed with an empty string, which has been corrected. * jc/all-negative-pathspec: pathspec: correct an empty string used as a pathspec element
Diffstat (limited to 'pathspec.c')
-rw-r--r--pathspec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pathspec.c b/pathspec.c
index ddeeba7..84ad9c7 100644
--- a/pathspec.c
+++ b/pathspec.c
@@ -629,7 +629,7 @@ void parse_pathspec(struct pathspec *pathspec,
*/
if (nr_exclude == n) {
int plen = (!(flags & PATHSPEC_PREFER_CWD)) ? 0 : prefixlen;
- init_pathspec_item(item + n, 0, prefix, plen, "");
+ init_pathspec_item(item + n, 0, prefix, plen, ".");
pathspec->nr++;
}