sha1_file: make check_and_freshen_file() non static

This function will be used in a commit soon, so let's make it available globally. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Christian Couder committed Feb 27, 2017 at 19:00 UTC 6a5e6f5e4496d5647e9b11352d055efed434029e
2 files changed +4 -1
cache.h
+3
@@ -1170,6 +1170,9 @@ extern int has_pack_index(const unsigned char *sha1);
1170
1171 extern void assert_sha1_type(const unsigned char *sha1, enum object_type expect);
1172
1173 +/* Helper to check and "touch" a file */
1174 +extern int check_and_freshen_file(const char *fn, int freshen);
1175 +
1176 extern const signed char hexval_table[256];
1177 static inline unsigned int hexval(unsigned char c)
1178 {
sha1_file.c
+1 -1
@@ -601,7 +601,7 @@ static int freshen_file(const char *fn)
601 * either does not exist on disk, or has a stale mtime and may be subject to
602 * pruning).
603 */
604 -static int check_and_freshen_file(const char *fn, int freshen)
604 +int check_and_freshen_file(const char *fn, int freshen)
605 {
606 if (access(fn, F_OK))
607 return 0;