Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-05-13 03:50:29 +0400
committerJunio C Hamano <gitster@pobox.com>2011-05-17 09:13:34 +0400
commitb9a62cbeb91e52aea8fc427a84e72f475dfe60cf (patch)
tree3ff64286b90eb6df7821309f0b69866fe406bbfd
parent02071b27f1587c65ddc4779017a3ddceb777de9c (diff)
packed_object_info_detail(): do not return a string
Instead return an integer that can be given to typename() if the caller wants a string, just like everybody else does. Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/verify-pack.c4
-rw-r--r--cache.h2
-rw-r--r--sha1_file.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/builtin/verify-pack.c b/builtin/verify-pack.c
index b6079ae6cb..3a919b1707 100644
--- a/builtin/verify-pack.c
+++ b/builtin/verify-pack.c
@@ -33,9 +33,9 @@ static void show_pack_info(struct packed_git *p, unsigned int flags)
if (!sha1)
die("internal error pack-check nth-packed-object");
offset = nth_packed_object_offset(p, i);
- type = packed_object_info_detail(p, offset, &size, &store_size,
+ type = typename(packed_object_info_detail(p, offset, &size, &store_size,
&delta_chain_length,
- base_sha1);
+ base_sha1));
if (!stat_only)
printf("%s ", sha1_to_hex(sha1));
if (!delta_chain_length) {
diff --git a/cache.h b/cache.h
index b1b5bb5896..cdb51120a0 100644
--- a/cache.h
+++ b/cache.h
@@ -1020,7 +1020,7 @@ extern off_t find_pack_entry_one(const unsigned char *, struct packed_git *);
extern void *unpack_entry(struct packed_git *, off_t, enum object_type *, unsigned long *);
extern unsigned long unpack_object_header_buffer(const unsigned char *buf, unsigned long len, enum object_type *type, unsigned long *sizep);
extern unsigned long get_size_from_delta(struct packed_git *, struct pack_window **, off_t);
-extern const char *packed_object_info_detail(struct packed_git *, off_t, unsigned long *, unsigned long *, unsigned int *, unsigned char *);
+extern int packed_object_info_detail(struct packed_git *, off_t, unsigned long *, unsigned long *, unsigned int *, unsigned char *);
/* Dumb servers support */
extern int update_server_info(int);
diff --git a/sha1_file.c b/sha1_file.c
index 064a330408..4f96eb1a3e 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1549,7 +1549,7 @@ static int unpack_object_header(struct packed_git *p,
return type;
}
-const char *packed_object_info_detail(struct packed_git *p,
+int packed_object_info_detail(struct packed_git *p,
off_t obj_offset,
unsigned long *size,
unsigned long *store_size,
@@ -1580,7 +1580,7 @@ const char *packed_object_info_detail(struct packed_git *p,
case OBJ_BLOB:
case OBJ_TAG:
unuse_pack(&w_curs);
- return typename(type);
+ return type;
case OBJ_OFS_DELTA:
obj_offset = get_delta_base(p, &w_curs, &curpos, type, obj_offset);
if (!obj_offset)