From 29c0e902a803d8865b9421edadf2ca7c565e355c Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Wed, 20 Sep 2017 21:41:12 -0700 Subject: pathspec doc: parse_pathspec does not maintain references to args The command line arguments passed to main() are valid for the life of a program, but the same is not true for all other argv-style arrays (e.g. when a caller creates an argv_array). Clarify that parse_pathspec does not rely on the argv passed to it to remain valid. This makes it easier to tell that callers like "git rev-list --stdin" are safe and ensures that that is more likely to remain true as the implementation of parse_pathspec evolves. Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- pathspec.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'pathspec.c') diff --git a/pathspec.c b/pathspec.c index e2a23ebc96..cdefdc7cc0 100644 --- a/pathspec.c +++ b/pathspec.c @@ -526,10 +526,6 @@ static void NORETURN unsupported_magic(const char *pattern, pattern, sb.buf); } -/* - * Given command line arguments and a prefix, convert the input to - * pathspec. die() if any magic in magic_mask is used. - */ void parse_pathspec(struct pathspec *pathspec, unsigned magic_mask, unsigned flags, const char *prefix, const char **argv) -- cgit v1.2.3