diff options
author | Vincent Ambo <tazjin@google.com> | 2020-05-25T23·06+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-05-25T23·06+0100 |
commit | 93ba78d6f4632ef1c5228965e3edc8c0faf88c1e (patch) | |
tree | 85730c182a9f5f492ade8e8ccdb1c2356f9900bd /third_party/git/builtin/rev-parse.c | |
parent | 6f8fbf4aa4b1654ab27d4829e114538761817de0 (diff) |
revert(3p/git): Revert merge of git upstream at v2.26.2 r/852
This causes cgit to serve error pages, which is undesirable. This reverts commit 5229c9b232de5bfa959ad6ebbb4c8192ac513352, reversing changes made to f2b211131f2347342dde63975b09cf603149f1a3.
Diffstat (limited to 'third_party/git/builtin/rev-parse.c')
-rw-r--r-- | third_party/git/builtin/rev-parse.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/third_party/git/builtin/rev-parse.c b/third_party/git/builtin/rev-parse.c index 7a00da820355..f8bbe6d47ec3 100644 --- a/third_party/git/builtin/rev-parse.c +++ b/third_party/git/builtin/rev-parse.c @@ -593,7 +593,6 @@ 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); @@ -731,8 +730,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 (hexsz <= abbrev) - abbrev = hexsz; + else if (40 <= abbrev) + abbrev = 40; continue; } if (!strcmp(arg, "--sq")) { @@ -803,8 +802,6 @@ 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")) { @@ -921,17 +918,6 @@ 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; |