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
33
third_party/git/builtin/rev-parse.c
vendored
33
third_party/git/builtin/rev-parse.c
vendored
|
|
@ -16,6 +16,7 @@
|
|||
#include "split-index.h"
|
||||
#include "submodule.h"
|
||||
#include "commit-reach.h"
|
||||
#include "shallow.h"
|
||||
|
||||
#define DO_REVS 1
|
||||
#define DO_NOREV 2
|
||||
|
|
@ -135,7 +136,7 @@ static void show_rev(int type, const struct object_id *oid, const char *name)
|
|||
struct object_id discard;
|
||||
char *full;
|
||||
|
||||
switch (dwim_ref(name, strlen(name), &discard, &full)) {
|
||||
switch (dwim_ref(name, strlen(name), &discard, &full, 0)) {
|
||||
case 0:
|
||||
/*
|
||||
* Not found -- not a ref. We could
|
||||
|
|
@ -593,6 +594,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
|
|||
const char *name = NULL;
|
||||
struct object_context unused;
|
||||
struct strbuf buf = STRBUF_INIT;
|
||||
const int hexsz = the_hash_algo->hexsz;
|
||||
|
||||
if (argc > 1 && !strcmp("--parseopt", argv[1]))
|
||||
return cmd_parseopt(argc - 1, argv + 1, prefix);
|
||||
|
|
@ -730,8 +732,8 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
|
|||
abbrev = strtoul(arg, NULL, 10);
|
||||
if (abbrev < MINIMUM_ABBREV)
|
||||
abbrev = MINIMUM_ABBREV;
|
||||
else if (40 <= abbrev)
|
||||
abbrev = 40;
|
||||
else if (hexsz <= abbrev)
|
||||
abbrev = hexsz;
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(arg, "--sq")) {
|
||||
|
|
@ -802,12 +804,15 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
|
|||
const char *work_tree = get_git_work_tree();
|
||||
if (work_tree)
|
||||
puts(work_tree);
|
||||
else
|
||||
die("this operation must be run in a work tree");
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(arg, "--show-superproject-working-tree")) {
|
||||
const char *superproject = get_superproject_working_tree();
|
||||
if (superproject)
|
||||
puts(superproject);
|
||||
struct strbuf superproject = STRBUF_INIT;
|
||||
if (get_superproject_working_tree(&superproject))
|
||||
puts(superproject.buf);
|
||||
strbuf_release(&superproject);
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(arg, "--show-prefix")) {
|
||||
|
|
@ -854,7 +859,10 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
|
|||
if (!gitdir && !prefix)
|
||||
gitdir = ".git";
|
||||
if (gitdir) {
|
||||
puts(real_path(gitdir));
|
||||
struct strbuf realpath = STRBUF_INIT;
|
||||
strbuf_realpath(&realpath, gitdir, 1);
|
||||
puts(realpath.buf);
|
||||
strbuf_release(&realpath);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
@ -918,6 +926,17 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
|
|||
show_datestring("--min-age=", arg);
|
||||
continue;
|
||||
}
|
||||
if (opt_with_value(arg, "--show-object-format", &arg)) {
|
||||
const char *val = arg ? arg : "storage";
|
||||
|
||||
if (strcmp(val, "storage") &&
|
||||
strcmp(val, "input") &&
|
||||
strcmp(val, "output"))
|
||||
die("unknown mode for --show-object-format: %s",
|
||||
arg);
|
||||
puts(the_hash_algo->name);
|
||||
continue;
|
||||
}
|
||||
if (show_flag(arg) && verify)
|
||||
die_no_single_rev(quiet);
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue