merge(3p/git): Merge git subtree at v2.29.2
This also bumps the stable nixpkgs to 20.09 as of 2020-11-21, because there is some breakage in the git build related to the netrc credentials helper which someone has taken care of in nixpkgs. The stable channel is not used for anything other than git, so this should be fine. Change-Id: I3575a19dab09e1e9556cf8231d717de9890484fb
This commit is contained in:
parent
082c006c04
commit
f4609b896f
1485 changed files with 241535 additions and 109418 deletions
28
third_party/git/builtin/rm.c
vendored
28
third_party/git/builtin/rm.c
vendored
|
|
@ -235,7 +235,8 @@ static int check_local_mod(struct object_id *head, int index_only)
|
|||
}
|
||||
|
||||
static int show_only = 0, force = 0, index_only = 0, recursive = 0, quiet = 0;
|
||||
static int ignore_unmatch = 0;
|
||||
static int ignore_unmatch = 0, pathspec_file_nul;
|
||||
static char *pathspec_from_file;
|
||||
|
||||
static struct option builtin_rm_options[] = {
|
||||
OPT__DRY_RUN(&show_only, N_("dry run")),
|
||||
|
|
@ -245,6 +246,8 @@ static struct option builtin_rm_options[] = {
|
|||
OPT_BOOL('r', NULL, &recursive, N_("allow recursive removal")),
|
||||
OPT_BOOL( 0 , "ignore-unmatch", &ignore_unmatch,
|
||||
N_("exit with a zero status even if nothing matched")),
|
||||
OPT_PATHSPEC_FROM_FILE(&pathspec_from_file),
|
||||
OPT_PATHSPEC_FILE_NUL(&pathspec_file_nul),
|
||||
OPT_END(),
|
||||
};
|
||||
|
||||
|
|
@ -259,8 +262,24 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
|
|||
|
||||
argc = parse_options(argc, argv, prefix, builtin_rm_options,
|
||||
builtin_rm_usage, 0);
|
||||
if (!argc)
|
||||
usage_with_options(builtin_rm_usage, builtin_rm_options);
|
||||
|
||||
parse_pathspec(&pathspec, 0,
|
||||
PATHSPEC_PREFER_CWD,
|
||||
prefix, argv);
|
||||
|
||||
if (pathspec_from_file) {
|
||||
if (pathspec.nr)
|
||||
die(_("--pathspec-from-file is incompatible with pathspec arguments"));
|
||||
|
||||
parse_pathspec_file(&pathspec, 0,
|
||||
PATHSPEC_PREFER_CWD,
|
||||
prefix, pathspec_from_file, pathspec_file_nul);
|
||||
} else if (pathspec_file_nul) {
|
||||
die(_("--pathspec-file-nul requires --pathspec-from-file"));
|
||||
}
|
||||
|
||||
if (!pathspec.nr)
|
||||
die(_("No pathspec was given. Which files should I remove?"));
|
||||
|
||||
if (!index_only)
|
||||
setup_work_tree();
|
||||
|
|
@ -270,9 +289,6 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
|
|||
if (read_cache() < 0)
|
||||
die(_("index file corrupt"));
|
||||
|
||||
parse_pathspec(&pathspec, 0,
|
||||
PATHSPEC_PREFER_CWD,
|
||||
prefix, argv);
|
||||
refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, &pathspec, NULL, NULL);
|
||||
|
||||
seen = xcalloc(pathspec.nr, 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue