Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
handle_one_ref(): rewrite to take an object_id argument
author
Michael Haggerty
<mhagger@alum.mit.edu>
Mon, 25 May 2015 18:39:05 +0000
(18:39 +0000)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 25 May 2015 19:19:35 +0000
(12:19 -0700)
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_name.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
e2b0bcd
)
diff --git
a/sha1_name.c
b/sha1_name.c
index 1aad0a3223564bea10fd470dfc83e3329b75e5c3..1cb810877af3eee2690f094897e5895da7af41fc 100644
(file)
--- a/
sha1_name.c
+++ b/
sha1_name.c
@@
-831,11
+831,11
@@
static int get_sha1_1(const char *name, int len, unsigned char *sha1, unsigned l
/* Remember to update object flag allocation in object.h */
#define ONELINE_SEEN (1u<<20)
/* Remember to update object flag allocation in object.h */
#define ONELINE_SEEN (1u<<20)
-static int handle_one_ref(const char *path,
-
const unsigned char *sha1,
int flag, void *cb_data)
+static int handle_one_ref(const char *path,
const struct object_id *oid,
+
int flag, void *cb_data)
{
struct commit_list **list = cb_data;
{
struct commit_list **list = cb_data;
- struct object *object = parse_object(
sha1
);
+ struct object *object = parse_object(
oid->hash
);
if (!object)
return 0;
if (object->type == OBJ_TAG) {
if (!object)
return 0;
if (object->type == OBJ_TAG) {
@@
-1371,10
+1371,8
@@
static int get_sha1_with_context_1(const char *name,
int pos;
if (!only_to_die && namelen > 2 && name[1] == '/') {
struct commit_list *list = NULL;
int pos;
if (!only_to_die && namelen > 2 && name[1] == '/') {
struct commit_list *list = NULL;
- struct each_ref_fn_sha1_adapter wrapped_handle_one_ref =
- {handle_one_ref, &list};
- for_each_ref(
each_ref_fn_adapter, &wrapped_handle_one_ref
);
+ for_each_ref(
handle_one_ref, &list
);
commit_list_sort_by_date(&list);
return get_sha1_oneline(name + 2, sha1, list);
}
commit_list_sort_by_date(&list);
return get_sha1_oneline(name + 2, sha1, list);
}