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>
Jeff King committed
Jul 12, 2013 at 02:21 UTC
f2f57e31f671983ef4d6272c082f9fb06daa3429
1 file changed
+10
-10
sha1_file.c
+10
-10
@@ -2375,7 +2375,7 @@ int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi)
2375
{
2376
struct cached_object *co;
2377
struct pack_entry e;
2378
- int status, rtype;
2378
+ int type, rtype;
2379
2380
co = find_cached_object(sha1);
2381
if (co) {
@@ -2389,23 +2389,23 @@ int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi)
2389
2390
if (!find_pack_entry(sha1, &e)) {
2391
/* Most likely it's a loose object. */
2392
- status = sha1_loose_object_info(sha1, oi->sizep, oi->disk_sizep);
2393
- if (status >= 0) {
2392
+ type = sha1_loose_object_info(sha1, oi->sizep, oi->disk_sizep);
2393
+ if (type >= 0) {
2394
oi->whence = OI_LOOSE;
2395
- return status;
2395
+ return type;
2396
}
2397
2398
/* Not a loose object; someone else may have just packed it. */
2399
reprepare_packed_git();
2400
if (!find_pack_entry(sha1, &e))
2401
- return status;
2401
+ return type;
2402
}
2403
2404
- status = packed_object_info(e.p, e.offset, oi->sizep, &rtype,
2405
- oi->disk_sizep);
2406
- if (status < 0) {
2404
+ type = packed_object_info(e.p, e.offset, oi->sizep, &rtype,
2405
+ oi->disk_sizep);
2406
+ if (type < 0) {
2407
mark_bad_packed_object(e.p, sha1);
2408
- status = sha1_object_info_extended(sha1, oi);
2408
+ type = sha1_object_info_extended(sha1, oi);
2409
} else if (in_delta_base_cache(e.p, e.offset)) {
2410
oi->whence = OI_DBCACHED;
2411
} else {
@@ -2416,7 +2416,7 @@ int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi)
2416
rtype == OBJ_OFS_DELTA);
2417
}
2418
2419
- return status;
2419
+ return type;
2420
}
2421
2422
int sha1_object_info(const unsigned char *sha1, unsigned long *sizep)