diff options
| author | Junio C Hamano <gitster@pobox.com> | 2023-12-09 16:37:49 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-12-09 16:37:49 -0800 |
| commit | d8b0ec44b13f7ee4dd6c8c726b5c105f66a51329 (patch) | |
| tree | 5e1b2162152023286664719ad30d834833fb9cd4 /builtin/add.c | |
| parent | Merge branch 'jk/chunk-bounds-more' (diff) | |
| parent | attr: enable attr pathspec magic for git-add and git-stash (diff) | |
| download | git-d8b0ec44b13f7ee4dd6c8c726b5c105f66a51329.tar.gz git-d8b0ec44b13f7ee4dd6c8c726b5c105f66a51329.zip | |
Merge branch 'jw/git-add-attr-pathspec'
"git add" and "git stash" learned to support the ":(attr:...)"
magic pathspec.
* jw/git-add-attr-pathspec:
attr: enable attr pathspec magic for git-add and git-stash
Diffstat (limited to 'builtin/add.c')
| -rw-r--r-- | builtin/add.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/builtin/add.c b/builtin/add.c index 5126d2ede3..d46e4d10e9 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -424,7 +424,7 @@ int cmd_add(int argc, const char **argv, const char *prefix) * Check the "pathspec '%s' did not match any files" block * below before enabling new magic. */ - parse_pathspec(&pathspec, PATHSPEC_ATTR, + parse_pathspec(&pathspec, 0, PATHSPEC_PREFER_FULL | PATHSPEC_SYMLINK_LEADING_PATH, prefix, argv); @@ -433,7 +433,7 @@ int cmd_add(int argc, const char **argv, const char *prefix) if (pathspec.nr) die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file"); - parse_pathspec_file(&pathspec, PATHSPEC_ATTR, + parse_pathspec_file(&pathspec, 0, PATHSPEC_PREFER_FULL | PATHSPEC_SYMLINK_LEADING_PATH, prefix, pathspec_from_file, pathspec_file_nul); @@ -504,7 +504,8 @@ int cmd_add(int argc, const char **argv, const char *prefix) PATHSPEC_LITERAL | PATHSPEC_GLOB | PATHSPEC_ICASE | - PATHSPEC_EXCLUDE); + PATHSPEC_EXCLUDE | + PATHSPEC_ATTR); for (i = 0; i < pathspec.nr; i++) { const char *path = pathspec.items[i].match; |
