Thread (58 messages) flat view 58 messages, 2 authors, 2016-06-15
STALE3754d

Revision v3 of 3 in this series.

Revisions (3)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v3 current

[PATCH v3 05/56] register_ref(): rewrite to take an object_id argument

From: brian m. carlson <hidden>
Date: 2016-06-15 23:04:55
Subsystem: the rest · Maintainer: Linus Torvalds

From: Michael Haggerty <redacted>

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
---
 bisect.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/bisect.c b/bisect.c
index 0848d91..03d5cd9 100644
--- a/bisect.c
+++ b/bisect.c
@@ -400,16 +400,16 @@ struct commit_list *find_bisection(struct commit_list *list,
 	return best;
 }
 
-static int register_ref(const char *refname, const unsigned char *sha1,
+static int register_ref(const char *refname, const struct object_id *oid,
 			int flags, void *cb_data)
 {
 	if (!strcmp(refname, "bad")) {
 		current_bad_oid = xmalloc(sizeof(*current_bad_oid));
-		hashcpy(current_bad_oid->hash, sha1);
+		oidcpy(current_bad_oid, oid);
 	} else if (starts_with(refname, "good-")) {
-		sha1_array_append(&good_revs, sha1);
+		sha1_array_append(&good_revs, oid->hash);
 	} else if (starts_with(refname, "skip-")) {
-		sha1_array_append(&skipped_revs, sha1);
+		sha1_array_append(&skipped_revs, oid->hash);
 	}
 
 	return 0;
@@ -417,10 +417,7 @@ static int register_ref(const char *refname, const unsigned char *sha1,
 
 static int read_bisect_refs(void)
 {
-	struct each_ref_fn_sha1_adapter wrapped_register_ref =
-		{register_ref, NULL};
-
-	return for_each_ref_in("refs/bisect/", each_ref_fn_adapter, &wrapped_register_ref);
+	return for_each_ref_in("refs/bisect/", register_ref, NULL);
 }
 
 static void read_bisect_paths(struct argv_array *array)
-- 
2.4.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help