commit | f9a8672a81277b83cabd59c6705089351c4f3ec4 | [log] [tgz] |
---|---|---|
author | Jonathan Tan <jonathantanmy@google.com> | Fri Aug 18 15:20:37 2017 -0700 |
committer | Junio C Hamano <gitster@pobox.com> | Wed Aug 23 15:12:07 2017 -0700 |
tree | 35cc126bff3151f8ecc74e3bc96b6318370fa526 | |
parent | 150e3001d0c5cc69db72a10f3e0cd1e14f11acba [diff] [blame] |
pack: move has_pack_index() Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff --git a/packfile.c b/packfile.c index 322c43d..84d16bf 100644 --- a/packfile.c +++ b/packfile.c
@@ -1846,3 +1846,11 @@ int has_sha1_pack(const unsigned char *sha1) struct pack_entry e; return find_pack_entry(sha1, &e); } + +int has_pack_index(const unsigned char *sha1) +{ + struct stat st; + if (stat(sha1_pack_index_name(sha1), &st)) + return 0; + return 1; +}