Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
append_ref(): rewrite to take an object_id argument
author
Michael Haggerty
<mhagger@alum.mit.edu>
Mon, 25 May 2015 18:38:32 +0000
(18:38 +0000)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 25 May 2015 19:19:28 +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>
builtin/branch.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
eed2514
)
diff --git
a/builtin/branch.c
b/builtin/branch.c
index b27adcb2ceba22a2c79fefb62647d9dcb4b90fc2..0d3b9af6e9ebc57944def4ce0f7b0feadf4b66c2 100644
(file)
--- a/
builtin/branch.c
+++ b/
builtin/branch.c
@@
-328,7
+328,7
@@
static int match_patterns(const char **pattern, const char *refname)
return 0;
}
return 0;
}
-static int append_ref(const char *refname, const
unsigned char *sha1
, int flags, void *cb_data)
+static int append_ref(const char *refname, const
struct object_id *oid
, int flags, void *cb_data)
{
struct append_ref_cb *cb = (struct append_ref_cb *)(cb_data);
struct ref_list *ref_list = cb->ref_list;
{
struct append_ref_cb *cb = (struct append_ref_cb *)(cb_data);
struct ref_list *ref_list = cb->ref_list;
@@
-365,7
+365,7
@@
static int append_ref(const char *refname, const unsigned char *sha1, int flags,
commit = NULL;
if (ref_list->verbose || ref_list->with_commit || merge_filter != NO_FILTER) {
commit = NULL;
if (ref_list->verbose || ref_list->with_commit || merge_filter != NO_FILTER) {
- commit = lookup_commit_reference_gently(
sha1
, 1);
+ commit = lookup_commit_reference_gently(
oid->hash
, 1);
if (!commit) {
cb->ret = error(_("branch '%s' does not point at a commit"), refname);
return 0;
if (!commit) {
cb->ret = error(_("branch '%s' does not point at a commit"), refname);
return 0;
@@
-631,8
+631,6
@@
static int print_ref_list(int kinds, int detached, int verbose, int abbrev, stru
int i;
struct append_ref_cb cb;
struct ref_list ref_list;
int i;
struct append_ref_cb cb;
struct ref_list ref_list;
- struct each_ref_fn_sha1_adapter wrapped_append_ref =
- {append_ref, &cb};
memset(&ref_list, 0, sizeof(ref_list));
ref_list.kinds = kinds;
memset(&ref_list, 0, sizeof(ref_list));
ref_list.kinds = kinds;
@@
-644,7
+642,7
@@
static int print_ref_list(int kinds, int detached, int verbose, int abbrev, stru
cb.ref_list = &ref_list;
cb.pattern = pattern;
cb.ret = 0;
cb.ref_list = &ref_list;
cb.pattern = pattern;
cb.ret = 0;
- for_each_rawref(
each_ref_fn_adapter, &wrapped_append_ref
);
+ for_each_rawref(
append_ref, &cb
);
if (merge_filter != NO_FILTER) {
struct commit *filter;
filter = lookup_commit_reference_gently(merge_filter_ref, 0);
if (merge_filter != NO_FILTER) {
struct commit *filter;
filter = lookup_commit_reference_gently(merge_filter_ref, 0);