summaryrefslogtreecommitdiff
path: root/builtin/update-index.c
diff options
context:
space:
mode:
authorLibravatar brian m. carlson <sandals@crustytoothpaste.net>2017-10-15 22:06:56 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-10-16 11:05:50 +0900
commit34c290a6fc8b1f6705d2646d726df2260927da0f (patch)
tree669c6569783ec61850be600dcd1b8496cabbf66d /builtin/update-index.c
parentrefs: convert resolve_refdup and refs_resolve_refdup to struct object_id (diff)
downloadtgif-34c290a6fc8b1f6705d2646d726df2260927da0f.tar.xz
refs: convert read_ref and read_ref_full to object_id
All but two of the call sites already have parameters using the hash parameter of struct object_id, so convert them to take a pointer to the struct directly. Also convert refs_read_refs_full, the underlying implementation. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/update-index.c')
-rw-r--r--builtin/update-index.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/update-index.c b/builtin/update-index.c
index bf7420b808..24f4b28951 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -679,9 +679,9 @@ static int unresolve_one(const char *path)
static void read_head_pointers(void)
{
- if (read_ref("HEAD", head_oid.hash))
+ if (read_ref("HEAD", &head_oid))
die("No HEAD -- no initial commit yet?");
- if (read_ref("MERGE_HEAD", merge_head_oid.hash)) {
+ if (read_ref("MERGE_HEAD", &merge_head_oid)) {
fprintf(stderr, "Not in the middle of a merge.\n");
exit(0);
}
@@ -721,7 +721,7 @@ static int do_reupdate(int ac, const char **av,
PATHSPEC_PREFER_CWD,
prefix, av + 1);
- if (read_ref("HEAD", head_oid.hash))
+ if (read_ref("HEAD", &head_oid))
/* If there is no HEAD, that means it is an initial
* commit. Update everything in the index.
*/