From 93ba78d6f4632ef1c5228965e3edc8c0faf88c1e Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 26 May 2020 00:06:52 +0100 Subject: revert(3p/git): Revert merge of git upstream at v2.26.2 This causes cgit to serve error pages, which is undesirable. This reverts commit 5229c9b232de5bfa959ad6ebbb4c8192ac513352, reversing changes made to f2b211131f2347342dde63975b09cf603149f1a3. --- third_party/git/pathspec.c | 47 ++-------------------------------------------- 1 file changed, 2 insertions(+), 45 deletions(-) (limited to 'third_party/git/pathspec.c') diff --git a/third_party/git/pathspec.c b/third_party/git/pathspec.c index 8243e06eab..12c2b322b3 100644 --- a/third_party/git/pathspec.c +++ b/third_party/git/pathspec.c @@ -3,8 +3,6 @@ #include "dir.h" #include "pathspec.h" #include "attr.h" -#include "argv-array.h" -#include "quote.h" /* * Finds which of the given pathspecs match items in the index. @@ -438,13 +436,8 @@ static void init_pathspec_item(struct pathspec_item *item, unsigned flags, } else { match = prefix_path_gently(prefix, prefixlen, &prefixlen, copyfrom); - if (!match) { - const char *hint_path = get_git_work_tree(); - if (!hint_path) - hint_path = get_git_dir(); - die(_("%s: '%s' is outside repository at '%s'"), elt, - copyfrom, absolute_path(hint_path)); - } + if (!match) + die(_("%s: '%s' is outside repository"), elt, copyfrom); } item->match = match; @@ -620,42 +613,6 @@ void parse_pathspec(struct pathspec *pathspec, } } -void parse_pathspec_file(struct pathspec *pathspec, unsigned magic_mask, - unsigned flags, const char *prefix, - const char *file, int nul_term_line) -{ - struct argv_array parsed_file = ARGV_ARRAY_INIT; - strbuf_getline_fn getline_fn = nul_term_line ? strbuf_getline_nul : - strbuf_getline; - struct strbuf buf = STRBUF_INIT; - struct strbuf unquoted = STRBUF_INIT; - FILE *in; - - if (!strcmp(file, "-")) - in = stdin; - else - in = xfopen(file, "r"); - - while (getline_fn(&buf, in) != EOF) { - if (!nul_term_line && buf.buf[0] == '"') { - strbuf_reset(&unquoted); - if (unquote_c_style(&unquoted, buf.buf, NULL)) - die(_("line is badly quoted: %s"), buf.buf); - strbuf_swap(&buf, &unquoted); - } - argv_array_push(&parsed_file, buf.buf); - strbuf_reset(&buf); - } - - strbuf_release(&unquoted); - strbuf_release(&buf); - if (in != stdin) - fclose(in); - - parse_pathspec(pathspec, magic_mask, flags, prefix, parsed_file.argv); - argv_array_clear(&parsed_file); -} - void copy_pathspec(struct pathspec *dst, const struct pathspec *src) { int i, j; -- cgit 1.4.1