Re: [PATCH v2] grep: support the --pathspec-from-file option
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Dec 6, 2019, 11:22 UTC
- Message-ID
- <nycvar.QRO.7.76.6.1912061220400.31080@tvgsbejvaqbjf.bet>
- In-Reply-To
- <20191204203911.237056-1-emilyshaffer@google.com>
Hi Emily,
On Wed, 4 Dec 2019, Emily Shaffer wrote:
Show 12 quoted lines
> diff --git a/builtin/grep.c b/builtin/grep.c
> index 50ce8d9461..54ba991c42 100644
> --- a/builtin/grep.c
> +++ b/builtin/grep.c
> @@ -809,6 +813,8 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
> int use_index = 1;
> int pattern_type_arg = GREP_PATTERN_TYPE_UNSPECIFIED;
> int allow_revs;
> + char *pathspec_from_file;
> + int pathspec_file_nul;
>
> struct option options[] = {I need this on top to make it work without problems (I have not yet triggered the CI build, but I will in a moment):
-- snipsnap -- Subject: [PATCH] fixup??? grep: support the --pathspec-from-file option
We must not use those variables uninitialized, this causes CI build failures left and right (see e.g. https://dev.azure.com/gitgitgadget/git/_build/results?buildId=22821)
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> --- builtin/grep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/grep.c b/builtin/grep.c index 54ba991c425..c2aa1aeebd6 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -813,8 +813,8 @@ int cmd_grep(int argc, const char **argv, const char *prefix) int use_index = 1; int pattern_type_arg = GREP_PATTERN_TYPE_UNSPECIFIED; int allow_revs; - char *pathspec_from_file; - int pathspec_file_nul; + char *pathspec_from_file = NULL; + int pathspec_file_nul = 0; struct option options[] = { OPT_BOOL(0, "cached", &cached, -- 2.24.0.windows.2.611.ge9aced84530