diff options
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/am.c | 6 | ||||
-rw-r--r-- | builtin/cat-file.c | 6 | ||||
-rw-r--r-- | builtin/commit-tree.c | 4 | ||||
-rw-r--r-- | builtin/commit.c | 8 | ||||
-rw-r--r-- | builtin/grep.c | 4 | ||||
-rw-r--r-- | builtin/log.c | 4 | ||||
-rw-r--r-- | builtin/replace.c | 4 | ||||
-rw-r--r-- | builtin/reset.c | 10 | ||||
-rw-r--r-- | builtin/rev-parse.c | 6 | ||||
-rw-r--r-- | builtin/show-branch.c | 8 |
10 files changed, 30 insertions, 30 deletions
diff --git a/builtin/am.c b/builtin/am.c index c973bd96dc..40cc6d6fe8 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -1131,7 +1131,7 @@ static int index_has_changes(struct strbuf *sb) struct object_id head; int i; - if (!get_sha1_tree("HEAD", head.hash)) { + if (!get_oid_tree("HEAD", &head)) { struct diff_options opt; diff_setup(&opt); @@ -1432,7 +1432,7 @@ static void write_index_patch(const struct am_state *state) struct rev_info rev_info; FILE *fp; - if (!get_sha1_tree("HEAD", head.hash)) + if (!get_oid_tree("HEAD", &head)) tree = lookup_tree(&head); else tree = lookup_tree(&empty_tree_oid); @@ -1661,7 +1661,7 @@ static void do_commit(const struct am_state *state) if (write_cache_as_tree(tree.hash, 0, NULL)) die(_("git write-tree failed to write a tree")); - if (!get_sha1_commit("HEAD", parent.hash)) { + if (!get_oid_commit("HEAD", &parent)) { old_oid = &parent; commit_list_insert(lookup_commit(&parent), &parents); } else { diff --git a/builtin/cat-file.c b/builtin/cat-file.c index 96b786e489..1f035fb550 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@ -63,8 +63,8 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name, if (unknown_type) flags |= OBJECT_INFO_ALLOW_UNKNOWN_TYPE; - if (get_sha1_with_context(obj_name, GET_SHA1_RECORD_PATH, - oid.hash, &obj_context)) + if (get_oid_with_context(obj_name, GET_SHA1_RECORD_PATH, + &oid, &obj_context)) die("Not a valid object name %s", obj_name); if (!path) @@ -364,7 +364,7 @@ static void batch_one_object(const char *obj_name, struct batch_options *opt, int flags = opt->follow_symlinks ? GET_SHA1_FOLLOW_SYMLINKS : 0; enum follow_symlinks_result result; - result = get_sha1_with_context(obj_name, flags, data->oid.hash, &ctx); + result = get_oid_with_context(obj_name, flags, &data->oid, &ctx); if (result != FOUND) { switch (result) { case MISSING_OBJECT: diff --git a/builtin/commit-tree.c b/builtin/commit-tree.c index a4a923d7c0..19e898fa4e 100644 --- a/builtin/commit-tree.c +++ b/builtin/commit-tree.c @@ -56,7 +56,7 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix) struct object_id oid; if (argc <= ++i) usage(commit_tree_usage); - if (get_sha1_commit(argv[i], oid.hash)) + if (get_oid_commit(argv[i], &oid)) die("Not a valid object name %s", argv[i]); assert_sha1_type(oid.hash, OBJ_COMMIT); new_parent(lookup_commit(&oid), &parents); @@ -106,7 +106,7 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix) continue; } - if (get_sha1_tree(arg, tree_oid.hash)) + if (get_oid_tree(arg, &tree_oid)) die("Not a valid object name %s", arg); if (got_tree) die("Cannot give more than one trees"); diff --git a/builtin/commit.c b/builtin/commit.c index 8e93802511..4bbac014ab 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -510,7 +510,7 @@ static int run_status(FILE *fp, const char *index_file, const char *prefix, int s->index_file = index_file; s->fp = fp; s->nowarn = nowarn; - s->is_initial = get_sha1(s->reference, oid.hash) ? 1 : 0; + s->is_initial = get_oid(s->reference, &oid) ? 1 : 0; if (!s->is_initial) hashcpy(s->sha1_commit, oid.hash); s->status_format = status_format; @@ -891,7 +891,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix, if (amend) parent = "HEAD^1"; - if (get_sha1(parent, oid.hash)) { + if (get_oid(parent, &oid)) { int i, ita_nr = 0; for (i = 0; i < active_nr; i++) @@ -1387,7 +1387,7 @@ int cmd_status(int argc, const char **argv, const char *prefix) fd = hold_locked_index(&index_lock, 0); - s.is_initial = get_sha1(s.reference, oid.hash) ? 1 : 0; + s.is_initial = get_oid(s.reference, &oid) ? 1 : 0; if (!s.is_initial) hashcpy(s.sha1_commit, oid.hash); @@ -1657,7 +1657,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix) status_format = STATUS_FORMAT_NONE; /* Ignore status.short */ s.colopts = 0; - if (get_sha1("HEAD", oid.hash)) + if (get_oid("HEAD", &oid)) current_head = NULL; else { current_head = lookup_commit_or_die(&oid, "HEAD"); diff --git a/builtin/grep.c b/builtin/grep.c index a0528321fe..f339567e66 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -1207,8 +1207,8 @@ int cmd_grep(int argc, const char **argv, const char *prefix) break; } - if (get_sha1_with_context(arg, GET_SHA1_RECORD_PATH, - oid.hash, &oc)) { + if (get_oid_with_context(arg, GET_SHA1_RECORD_PATH, + &oid, &oc)) { if (seen_dashdash) die(_("unable to resolve revision: %s"), arg); break; diff --git a/builtin/log.c b/builtin/log.c index c6362cf92e..413b760771 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -484,8 +484,8 @@ static int show_blob_object(const struct object_id *oid, struct rev_info *rev, c !DIFF_OPT_TST(&rev->diffopt, ALLOW_TEXTCONV)) return stream_blob_to_fd(1, oid, NULL, 0); - if (get_sha1_with_context(obj_name, GET_SHA1_RECORD_PATH, - oidc.hash, &obj_context)) + if (get_oid_with_context(obj_name, GET_SHA1_RECORD_PATH, + &oidc, &obj_context)) die(_("Not a valid object name %s"), obj_name); if (!obj_context.path || !textconv_object(obj_context.path, obj_context.mode, &oidc, 1, &buf, &size)) { diff --git a/builtin/replace.c b/builtin/replace.c index fba336a68a..f4a85a165b 100644 --- a/builtin/replace.c +++ b/builtin/replace.c @@ -50,7 +50,7 @@ static int show_reference(const char *refname, const struct object_id *oid, struct object_id object; enum object_type obj_type, repl_type; - if (get_sha1(refname, object.hash)) + if (get_oid(refname, &object)) return error("Failed to resolve '%s' as a valid ref.", refname); obj_type = sha1_object_info(object.hash, NULL); @@ -365,7 +365,7 @@ static void check_one_mergetag(struct commit *commit, /* iterate over new parents */ for (i = 1; i < mergetag_data->argc; i++) { struct object_id oid; - if (get_sha1(mergetag_data->argv[i], oid.hash) < 0) + if (get_oid(mergetag_data->argv[i], &oid) < 0) die(_("Not a valid object name: '%s'"), mergetag_data->argv[i]); if (!oidcmp(&tag->tagged->oid, &oid)) return; /* found */ diff --git a/builtin/reset.c b/builtin/reset.c index 7aeaea2737..046403ed68 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -219,8 +219,8 @@ static void parse_args(struct pathspec *pathspec, * has to be unambiguous. If there is a single argument, it * can not be a tree */ - else if ((!argv[1] && !get_sha1_committish(argv[0], unused.hash)) || - (argv[1] && !get_sha1_treeish(argv[0], unused.hash))) { + else if ((!argv[1] && !get_oid_committish(argv[0], &unused)) || + (argv[1] && !get_oid_treeish(argv[0], &unused))) { /* * Ok, argv[0] looks like a commit/tree; it should not * be a filename. @@ -310,13 +310,13 @@ int cmd_reset(int argc, const char **argv, const char *prefix) load_submodule_cache(); - unborn = !strcmp(rev, "HEAD") && get_sha1("HEAD", oid.hash); + unborn = !strcmp(rev, "HEAD") && get_oid("HEAD", &oid); if (unborn) { /* reset on unborn branch: treat as reset to empty tree */ hashcpy(oid.hash, EMPTY_TREE_SHA1_BIN); } else if (!pathspec.nr) { struct commit *commit; - if (get_sha1_committish(rev, oid.hash)) + if (get_oid_committish(rev, &oid)) die(_("Failed to resolve '%s' as a valid revision."), rev); commit = lookup_commit_reference(&oid); if (!commit) @@ -324,7 +324,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix) oidcpy(&oid, &commit->object.oid); } else { struct tree *tree; - if (get_sha1_treeish(rev, oid.hash)) + if (get_oid_treeish(rev, &oid)) die(_("Failed to resolve '%s' as a valid tree."), rev); tree = parse_tree_indirect(&oid); if (!tree) diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c index c78b7b33d6..041b7898c4 100644 --- a/builtin/rev-parse.c +++ b/builtin/rev-parse.c @@ -274,7 +274,7 @@ static int try_difference(const char *arg) return 0; } - if (!get_sha1_committish(this, oid.hash) && !get_sha1_committish(next, end.hash)) { + if (!get_oid_committish(this, &oid) && !get_oid_committish(next, &end)) { show_rev(NORMAL, &end, next); show_rev(symmetric ? NORMAL : REVERSED, &oid, this); if (symmetric) { @@ -328,7 +328,7 @@ static int try_parent_shorthands(const char *arg) return 0; *dotdot = 0; - if (get_sha1_committish(arg, oid.hash)) { + if (get_oid_committish(arg, &oid)) { *dotdot = '^'; return 0; } @@ -911,7 +911,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix) name++; type = REVERSED; } - if (!get_sha1_with_context(name, flags, oid.hash, &unused)) { + if (!get_oid_with_context(name, flags, &oid, &unused)) { if (verify) revs_count++; else diff --git a/builtin/show-branch.c b/builtin/show-branch.c index 7073a3eb97..6fa1f62a88 100644 --- a/builtin/show-branch.c +++ b/builtin/show-branch.c @@ -393,7 +393,7 @@ static int append_head_ref(const char *refname, const struct object_id *oid, /* If both heads/foo and tags/foo exists, get_sha1 would * get confused. */ - if (get_sha1(refname + ofs, tmp.hash) || oidcmp(&tmp, oid)) + if (get_oid(refname + ofs, &tmp) || oidcmp(&tmp, oid)) ofs = 5; return append_ref(refname + ofs, oid, 0); } @@ -408,7 +408,7 @@ static int append_remote_ref(const char *refname, const struct object_id *oid, /* If both heads/foo and tags/foo exists, get_sha1 would * get confused. */ - if (get_sha1(refname + ofs, tmp.hash) || oidcmp(&tmp, oid)) + if (get_oid(refname + ofs, &tmp) || oidcmp(&tmp, oid)) ofs = 5; return append_ref(refname + ofs, oid, 0); } @@ -514,7 +514,7 @@ static int show_independent(struct commit **rev, static void append_one_rev(const char *av) { struct object_id revkey; - if (!get_sha1(av, revkey.hash)) { + if (!get_oid(av, &revkey)) { append_ref(av, &revkey, 0); return; } @@ -808,7 +808,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix) die(Q_("cannot handle more than %d rev.", "cannot handle more than %d revs.", MAX_REVS), MAX_REVS); - if (get_sha1(ref_name[num_rev], revkey.hash)) + if (get_oid(ref_name[num_rev], &revkey)) die(_("'%s' is not a valid ref."), ref_name[num_rev]); commit = lookup_commit_reference(&revkey); if (!commit) |