summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2013-07-12 02:21:22 -0400
committerJunio C Hamano <gitster@pobox.com>2013-07-12 10:10:03 -0700
commitf2f57e31f671983ef4d6272c082f9fb06daa3429 (patch)
treefc6316fa64e9a319e7f343f66409f60f4cceb70d /sha1_file.c
parent25fba78d36be6297bb17aed5f3e21ed850ce3e03 (diff)
downloadgit-f2f57e31f671983ef4d6272c082f9fb06daa3429.tar.gz
sha1_object_info_extended: rename "status" to "type"
The value we get from each low-level object_info function (e.g., loose, packed) is actually the object type (or -1 for error). Let's explicitly call it "type", which will make further refactorings easier to read. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 6baed676dc..f13dea3355 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2375,7 +2375,7 @@ int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi)
{
struct cached_object *co;
struct pack_entry e;
- int status, rtype;
+ int type, rtype;
co = find_cached_object(sha1);
if (co) {
@@ -2389,23 +2389,23 @@ int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi)
if (!find_pack_entry(sha1, &e)) {
/* Most likely it's a loose object. */
- status = sha1_loose_object_info(sha1, oi->sizep, oi->disk_sizep);
- if (status >= 0) {
+ type = sha1_loose_object_info(sha1, oi->sizep, oi->disk_sizep);
+ if (type >= 0) {
oi->whence = OI_LOOSE;
- return status;
+ return type;
}
/* Not a loose object; someone else may have just packed it. */
reprepare_packed_git();
if (!find_pack_entry(sha1, &e))
- return status;
+ return type;
}
- status = packed_object_info(e.p, e.offset, oi->sizep, &rtype,
- oi->disk_sizep);
- if (status < 0) {
+ type = packed_object_info(e.p, e.offset, oi->sizep, &rtype,
+ oi->disk_sizep);
+ if (type < 0) {
mark_bad_packed_object(e.p, sha1);
- status = sha1_object_info_extended(sha1, oi);
+ type = sha1_object_info_extended(sha1, oi);
} else if (in_delta_base_cache(e.p, e.offset)) {
oi->whence = OI_DBCACHED;
} else {
@@ -2416,7 +2416,7 @@ int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi)
rtype == OBJ_OFS_DELTA);
}
- return status;
+ return type;
}
int sha1_object_info(const unsigned char *sha1, unsigned long *sizep)