diff options
| author | Junio C Hamano <junkio@cox.net> | 2007-02-28 11:58:27 -0800 |
|---|---|---|
| committer | Junio C Hamano <junkio@cox.net> | 2007-02-28 11:58:27 -0800 |
| commit | 597388f6a1c18a117904c307c20542d8a79a1fcd (patch) | |
| tree | 035f1083845981205f2f73b5db158f1598c89d19 /builtin-for-each-ref.c | |
| parent | fbe3d87e5fcef2e0fff41c3b0589331c889dfb59 (diff) | |
| parent | 66035a6b3d629b546daef3784f5351d58f4f17b1 (diff) | |
| download | git-597388f6a1c18a117904c307c20542d8a79a1fcd.tar.gz | |
Merge branch 'np/types'
* np/types:
Cleanup check_valid in commit-tree.
make sure enum object_type is signed
get rid of lookup_object_type()
convert object type handling from a string to a number
formalize typename(), and add its reverse type_from_string()
sha1_file.c: don't ignore an error condition in sha1_loose_object_info()
sha1_file.c: cleanup "offset" usage
sha1_file.c: cleanup hdr usage
Diffstat (limited to 'builtin-for-each-ref.c')
| -rw-r--r-- | builtin-for-each-ref.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c index ac0b9f6088..b11ca928d6 100644 --- a/builtin-for-each-ref.c +++ b/builtin-for-each-ref.c @@ -173,8 +173,8 @@ static void verify_format(const char *format) */ static void *get_obj(const unsigned char *sha1, struct object **obj, unsigned long *sz, int *eaten) { - char type[20]; - void *buf = read_sha1_file(sha1, type, sz); + enum object_type type; + void *buf = read_sha1_file(sha1, &type, sz); if (buf) *obj = parse_object_buffer(sha1, type, *sz, buf, eaten); @@ -196,7 +196,7 @@ static void grab_common_values(struct atom_value *val, int deref, struct object if (deref) name++; if (!strcmp(name, "objecttype")) - v->s = type_names[obj->type]; + v->s = typename(obj->type); else if (!strcmp(name, "objectsize")) { char *s = xmalloc(40); sprintf(s, "%lu", sz); |
