summaryrefslogtreecommitdiff
path: root/pathspec.h
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-07-14 15:35:30 +0700
committerJunio C Hamano <gitster@pobox.com>2013-07-15 10:56:06 -0700
commitfc12261fea778cabd08dec707169cb88ecdbc647 (patch)
treecb9b424efb323cf5ed8c13bccad70c9a333ed35c /pathspec.h
parentd2ce1331953e9f4306e00f5edf3a6ce6e3330e9e (diff)
downloadgit-fc12261fea778cabd08dec707169cb88ecdbc647.tar.gz
parse_pathspec: add PATHSPEC_PREFER_{CWD,FULL} flags
We have two ways of dealing with empty pathspec: 1. limit it to current prefix 2. match the entire working directory Some commands go with #1, some #2. get_pathspec() and parse_pathspec() only support #1. Make parse_pathspec() reject empty pathspec by default. #1 and #2 can be specified via new flags. This makes it more expressive about default behavior at command level. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pathspec.h')
-rw-r--r--pathspec.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/pathspec.h b/pathspec.h
index cc5841b77f..d630e8b1f9 100644
--- a/pathspec.h
+++ b/pathspec.h
@@ -24,6 +24,10 @@ struct pathspec {
} *items;
};
+/* parse_pathspec flags */
+#define PATHSPEC_PREFER_CWD (1<<0) /* No args means match cwd */
+#define PATHSPEC_PREFER_FULL (1<<1) /* No args means match everything */
+
extern int init_pathspec(struct pathspec *, const char **);
extern void parse_pathspec(struct pathspec *pathspec,
unsigned magic_mask,