diff options
| author | Junio C Hamano <gitster@pobox.com> | 2014-07-22 10:59:36 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2014-07-22 10:59:37 -0700 |
| commit | 12621cb22224d1c2f507a643a578e386ee891c5c (patch) | |
| tree | d0ab888b37baa09db9c7ef74840b739ff3cafb09 /builtin/for-each-ref.c | |
| parent | 4328190a81ea5aef679774322c7f9faf06b453af (diff) | |
| parent | 1cefa143250ad8c60e2a3db6c18278f7bed508f5 (diff) | |
| download | git-12621cb22224d1c2f507a643a578e386ee891c5c.tar.gz | |
Merge branch 'rs/code-cleaning'
* rs/code-cleaning:
remote-testsvn: use internal argv_array of struct child_process in cmd_import()
bundle: use internal argv_array of struct child_process in create_bundle()
fast-import: use hashcmp() for SHA1 hash comparison
transport: simplify fetch_objs_via_rsync() using argv_array
run-command: use internal argv_array of struct child_process in run_hook_ve()
use commit_list_count() to count the members of commit_lists
strbuf: use strbuf_addstr() for adding C strings
Diffstat (limited to 'builtin/for-each-ref.c')
| -rw-r--r-- | builtin/for-each-ref.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c index 4135980f20..47bd624696 100644 --- a/builtin/for-each-ref.c +++ b/builtin/for-each-ref.c @@ -283,18 +283,6 @@ static void grab_tag_values(struct atom_value *val, int deref, struct object *ob } } -static int num_parents(struct commit *commit) -{ - struct commit_list *parents; - int i; - - for (i = 0, parents = commit->parents; - parents; - parents = parents->next) - i++; - return i; -} - /* See grab_values */ static void grab_commit_values(struct atom_value *val, int deref, struct object *obj, void *buf, unsigned long sz) { @@ -315,12 +303,12 @@ static void grab_commit_values(struct atom_value *val, int deref, struct object } if (!strcmp(name, "numparent")) { char *s = xmalloc(40); - v->ul = num_parents(commit); + v->ul = commit_list_count(commit->parents); sprintf(s, "%lu", v->ul); v->s = s; } else if (!strcmp(name, "parent")) { - int num = num_parents(commit); + int num = commit_list_count(commit->parents); int i; struct commit_list *parents; char *s = xmalloc(41 * num + 1); |
