[PATCH v4 14/22] sha1_file: make check_and_freshen_file() non static
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Feb 27, 2017, 18:00 UTC
- Message-ID
- <20170227180019.18666-15-chriscool@tuxfamily.org>
- In-Reply-To
- <20170227180019.18666-1-chriscool@tuxfamily.org>
This function will be used in a commit soon, so let's make it available globally.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org> --- cache.h | 3 +++ sha1_file.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/cache.h b/cache.h index 955e80913e..6b25b50aab 100644 --- a/cache.h +++ b/cache.h @@ -1229,6 +1229,9 @@ extern int has_pack_index(const unsigned char *sha1); extern void assert_sha1_type(const unsigned char *sha1, enum object_type expect); +/* Helper to check and "touch" a file */ +extern int check_and_freshen_file(const char *fn, int freshen); + extern const signed char hexval_table[256]; static inline unsigned int hexval(unsigned char c) { diff --git a/sha1_file.c b/sha1_file.c index ec957db5e1..192073ea95 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -593,7 +593,7 @@ static int freshen_file(const char *fn) * either does not exist on disk, or has a stale mtime and may be subject to * pruning). */ -static int check_and_freshen_file(const char *fn, int freshen) +int check_and_freshen_file(const char *fn, int freshen) { if (access(fn, F_OK)) return 0;
-- 2.12.0.22.g0672473d40