Skip to content

Commit f2f57e3

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 25fba78 commit f2f57e3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

sha1_file.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2375,7 +2375,7 @@ int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi)
23752375
{
23762376
struct cached_object *co;
23772377
struct pack_entry e;
2378-
int status, rtype;
2378+
int type, rtype;
23792379

23802380
co = find_cached_object(sha1);
23812381
if (co) {
@@ -2389,23 +2389,23 @@ int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi)
23892389

23902390
if (!find_pack_entry(sha1, &e)) {
23912391
/* 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) {
23942394
oi->whence = OI_LOOSE;
2395-
return status;
2395+
return type;
23962396
}
23972397

23982398
/* Not a loose object; someone else may have just packed it. */
23992399
reprepare_packed_git();
24002400
if (!find_pack_entry(sha1, &e))
2401-
return status;
2401+
return type;
24022402
}
24032403

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) {
24072407
mark_bad_packed_object(e.p, sha1);
2408-
status = sha1_object_info_extended(sha1, oi);
2408+
type = sha1_object_info_extended(sha1, oi);
24092409
} else if (in_delta_base_cache(e.p, e.offset)) {
24102410
oi->whence = OI_DBCACHED;
24112411
} else {
@@ -2416,7 +2416,7 @@ int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi)
24162416
rtype == OBJ_OFS_DELTA);
24172417
}
24182418

2419-
return status;
2419+
return type;
24202420
}
24212421

24222422
int sha1_object_info(const unsigned char *sha1, unsigned long *sizep)

0 commit comments

Comments
 (0)