From 2616a5e5089814188a583572bd9bf578b18a2a40 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Sun, 15 Oct 2017 22:06:50 +0000 Subject: refs: convert delete_ref and refs_delete_ref to struct object_id Convert delete_ref and refs_delete_ref to take a pointer to struct object_id. Update the documentation accordingly, including referring to null_oid in lowercase, as it is not a #define constant. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- builtin/branch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin/branch.c') diff --git a/builtin/branch.c b/builtin/branch.c index b67593288c..f5237541a2 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -257,7 +257,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds, goto next; } - if (delete_ref(NULL, name, is_null_oid(&oid) ? NULL : oid.hash, + if (delete_ref(NULL, name, is_null_oid(&oid) ? NULL : &oid, REF_NODEREF)) { error(remote_branch ? _("Error deleting remote-tracking branch '%s'") -- cgit v1.2.3 From 0f2dc722dd01097d1e1c1dac43b2f57924594457 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Sun, 15 Oct 2017 22:06:55 +0000 Subject: refs: convert resolve_refdup and refs_resolve_refdup to struct object_id All of the callers already pass the hash member of struct object_id, so update them to pass a pointer to the struct directly, This transformation was done with an update to declaration and definition and the following semantic patch: @@ expression E1, E2, E3, E4; @@ - resolve_refdup(E1, E2, E3.hash, E4) + resolve_refdup(E1, E2, &E3, E4) @@ expression E1, E2, E3, E4; @@ - resolve_refdup(E1, E2, E3->hash, E4) + resolve_refdup(E1, E2, E3, E4) Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- builtin/branch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'builtin/branch.c') diff --git a/builtin/branch.c b/builtin/branch.c index f5237541a2..c5f88b59ef 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -125,7 +125,7 @@ static int branch_merged(int kind, const char *name, if (upstream && (reference_name = reference_name_to_free = resolve_refdup(upstream, RESOLVE_REF_READING, - oid.hash, NULL)) != NULL) + &oid, NULL)) != NULL) reference_rev = lookup_commit_reference(&oid); } if (!reference_rev) @@ -241,7 +241,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds, RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE | RESOLVE_REF_ALLOW_BAD_NAME, - oid.hash, &flags); + &oid, &flags); if (!target) { error(remote_branch ? _("remote-tracking branch '%s' not found.") @@ -636,7 +636,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix) track = git_branch_track; - head = resolve_refdup("HEAD", 0, head_oid.hash, NULL); + head = resolve_refdup("HEAD", 0, &head_oid, NULL); if (!head) die(_("Failed to resolve HEAD as a valid ref.")); if (!strcmp(head, "HEAD")) -- cgit v1.2.3