diff options
author | Brandon Williams <bmwill@google.com> | 2017-05-12 01:04:24 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-05-12 08:23:46 +0300 |
commit | c08397e3aa46fd0f0da29dfe5b257839b9c5d1c8 (patch) | |
tree | 7b86e30521606f9953e249db7dd3792d3eb4fe62 /pathspec.h | |
parent | bdab972153a73815e04e9699406433e409ed28ab (diff) |
pathspec: remove PATHSPEC_STRIP_SUBMODULE_SLASH_EXPENSIVE flag
Since (ae8d08242 pathspec: pass directory indicator to
match_pathspec_item()) the path matching logic has been able to cope
with submodules without needing to strip off a trailing slash if a path
refers to a submodule.
Since the stripping the trailing slash is no longer necessary, remove
the PATHSPEC_STRIP_SUBMODULE_SLASH_EXPENSIVE flag. In addition, factor
out the logic which dies if a path decends into a submodule so that it
can still be used as a check after a pathspec struct has been
initialized.
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pathspec.h')
-rw-r--r-- | pathspec.h | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/pathspec.h b/pathspec.h index 55e976972c..3729efa85c 100644 --- a/pathspec.h +++ b/pathspec.h @@ -62,23 +62,15 @@ struct pathspec { #define PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP (1<<3) /* die if a symlink is part of the given path's directory */ #define PATHSPEC_SYMLINK_LEADING_PATH (1<<4) -/* - * This is like a combination of ..LEADING_PATH and .._SLASH_CHEAP - * (but not the same): it strips the trailing slash if the given path - * is a gitlink but also checks and dies if gitlink is part of the - * leading path (i.e. the given path goes beyond a submodule). It's - * safer than _SLASH_CHEAP and also more expensive. - */ -#define PATHSPEC_STRIP_SUBMODULE_SLASH_EXPENSIVE (1<<5) -#define PATHSPEC_PREFIX_ORIGIN (1<<6) -#define PATHSPEC_KEEP_ORDER (1<<7) +#define PATHSPEC_PREFIX_ORIGIN (1<<5) +#define PATHSPEC_KEEP_ORDER (1<<6) /* * For the callers that just need pure paths from somewhere else, not * from command line. Global --*-pathspecs options are ignored. No * magic is parsed in each pathspec either. If PATHSPEC_LITERAL is * allowed, then it will automatically set for every pathspec. */ -#define PATHSPEC_LITERAL_PATH (1<<8) +#define PATHSPEC_LITERAL_PATH (1<<7) extern void parse_pathspec(struct pathspec *pathspec, unsigned magic_mask, |