Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
sha1_file: convert retry_bad_packed_offset to struct object_id
author
brian m. carlson
<sandals@crustytoothpaste.net>
Mon, 12 Mar 2018 02:27:43 +0000
(
02:27
+0000)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 14 Mar 2018 16:23:49 +0000
(09:23 -0700)
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
packfile.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
e816caa
)
diff --git
a/packfile.c
b/packfile.c
index 7c1a2519fcb9c45aacf5481811bc26f44736de59..5f08aa0a145829d23421b681c5f83de49ea1bc3c 100644
(file)
--- a/
packfile.c
+++ b/
packfile.c
@@
-1095,13
+1095,13
@@
static int retry_bad_packed_offset(struct packed_git *p, off_t obj_offset)
{
int type;
struct revindex_entry *revidx;
-
const unsigned char *sha1
;
+
struct object_id oid
;
revidx = find_pack_revindex(p, obj_offset);
if (!revidx)
return OBJ_BAD;
-
sha1 = nth_packed_object_sha1(
p, revidx->nr);
- mark_bad_packed_object(p,
sha1
);
- type = sha1_object_info(
sha1
, NULL);
+
nth_packed_object_oid(&oid,
p, revidx->nr);
+ mark_bad_packed_object(p,
oid.hash
);
+ type = sha1_object_info(
oid.hash
, NULL);
if (type <= OBJ_NONE)
return OBJ_BAD;
return type;