diff options
Diffstat (limited to 'builtin/name-rev.c')
-rw-r--r-- | builtin/name-rev.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/builtin/name-rev.c b/builtin/name-rev.c index 97959bfaf9..4d15a23fc4 100644 --- a/builtin/name-rev.c +++ b/builtin/name-rev.c @@ -1,10 +1,15 @@ #include "builtin.h" -#include "cache.h" +#include "alloc.h" +#include "environment.h" +#include "gettext.h" +#include "hex.h" #include "repository.h" #include "config.h" #include "commit.h" #include "tag.h" #include "refs.h" +#include "object-name.h" +#include "pager.h" #include "parse-options.h" #include "prio-queue.h" #include "hash-lookup.h" @@ -181,7 +186,7 @@ static void name_rev(struct commit *start_commit, size_t parents_to_queue_nr, parents_to_queue_alloc = 0; struct rev_name *start_name; - parse_commit(start_commit); + repo_parse_commit(the_repository, start_commit); if (commit_is_before_cutoff(start_commit)) return; @@ -211,7 +216,7 @@ static void name_rev(struct commit *start_commit, struct rev_name *parent_name; int generation, distance; - parse_commit(parent); + repo_parse_commit(the_repository, parent); if (commit_is_before_cutoff(parent)) continue; @@ -493,7 +498,8 @@ static void show_name(const struct object *obj, else if (allow_undefined) printf("undefined\n"); else if (always) - printf("%s\n", find_unique_abbrev(oid, DEFAULT_ABBREV)); + printf("%s\n", + repo_find_unique_abbrev(the_repository, oid, DEFAULT_ABBREV)); else die("cannot describe '%s'", oid_to_hex(oid)); strbuf_release(&buf); @@ -527,7 +533,7 @@ static void name_rev_line(char *p, struct name_ref_data *data) counter = 0; *(p+1) = 0; - if (!get_oid(p - (hexsz - 1), &oid)) { + if (!repo_get_oid(the_repository, p - (hexsz - 1), &oid)) { struct object *o = lookup_object(the_repository, &oid); if (o) @@ -567,7 +573,11 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix) N_("ignore refs matching <pattern>")), OPT_GROUP(""), OPT_BOOL(0, "all", &all, N_("list all commits reachable from all refs")), - OPT_BOOL(0, "stdin", &transform_stdin, N_("deprecated: use --annotate-stdin instead")), + OPT_BOOL_F(0, + "stdin", + &transform_stdin, + N_("deprecated: use --annotate-stdin instead"), + PARSE_OPT_HIDDEN), OPT_BOOL(0, "annotate-stdin", &annotate_stdin, N_("annotate text from stdin")), OPT_BOOL(0, "undefined", &allow_undefined, N_("allow to print `undefined` names (default)")), OPT_BOOL(0, "always", &always, @@ -604,7 +614,7 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix) struct object *object; struct commit *commit; - if (get_oid(*argv, &oid)) { + if (repo_get_oid(the_repository, *argv, &oid)) { fprintf(stderr, "Could not get sha1 for %s. Skipping.\n", *argv); continue; |