diff options
| author | Carlos Martín Nieto <carlos@cmartin.tk> | 2011-07-21 22:55:20 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <carlos@cmartin.tk> | 2011-07-23 14:30:40 +0200 |
| commit | c3da9f062d8c202b2a66b289b3570ac9fe6fc02d (patch) | |
| tree | d9422e10600ac8c466953857d8e30ba8a873b500 /src/fileops.h | |
| parent | f630366f70aa9ddffb7c3001c371fae6b0a0c004 (diff) | |
| download | libgit2-c3da9f062d8c202b2a66b289b3570ac9fe6fc02d.tar.gz | |
Add git_futils_readbuffer_updated
This extends the git_fuitls_readbuffer function to only read in if the
file's modification date is later than the given one. Some code paths
want to check a file's modification date in order to decide whether
they should read it or not. If they do want to read it, another stat
call is done by futils. This function combines these two operations so
we avoid one stat call each time we read a new or updated file.
The git_futils_readbuffer functions is now a wrapper around the new
function.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Diffstat (limited to 'src/fileops.h')
| -rw-r--r-- | src/fileops.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/fileops.h b/src/fileops.h index f1c169c3a..84c35e41b 100644 --- a/src/fileops.h +++ b/src/fileops.h @@ -25,6 +25,7 @@ typedef struct { /* file io buffer */ } git_fbuffer; extern int git_futils_readbuffer(git_fbuffer *obj, const char *path); +extern int git_futils_readbuffer_updated(git_fbuffer *obj, const char *path, time_t *mtime, int *updated); extern void git_futils_freebuffer(git_fbuffer *obj); /** |
