diff options
| author | Russell Belfer <rb@github.com> | 2012-10-31 11:26:12 -0700 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2012-10-31 11:26:12 -0700 |
| commit | c8b511f3cdb3f7fa63600b36bb2412099998a805 (patch) | |
| tree | 493476084ca1c80ad27e3a00ef4cb7b2334ea7e7 /src/attr.c | |
| parent | 744cc03e2b6d77712bfcb504c272d2e646da650c (diff) | |
| download | libgit2-c8b511f3cdb3f7fa63600b36bb2412099998a805.tar.gz | |
Better naming for file timestamp/size checker
Diffstat (limited to 'src/attr.c')
| -rw-r--r-- | src/attr.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/attr.c b/src/attr.c index 50caa1e1b..4993e3a8f 100644 --- a/src/attr.c +++ b/src/attr.c @@ -261,13 +261,13 @@ bool git_attr_cache__is_cached( static int load_attr_file( const char **data, - git_futils_stat_sig *sig, + git_futils_file_stamp *stamp, const char *filename) { int error; git_buf content = GIT_BUF_INIT; - error = git_futils_stat_sig_needs_reload(sig, filename); + error = git_futils_file_stamp_has_changed(stamp, filename); if (error < 0) return error; @@ -380,7 +380,7 @@ int git_attr_cache__push_file( git_attr_cache *cache = git_repository_attr_cache(repo); git_attr_file *file = NULL; git_blob *blob = NULL; - git_futils_stat_sig sig; + git_futils_file_stamp stamp; assert(filename && stack); @@ -402,12 +402,10 @@ int git_attr_cache__push_file( /* if not in cache, load data, parse, and cache */ if (source == GIT_ATTR_FILE_FROM_FILE) { - if (file) - memcpy(&sig, &file->cache_data.sig, sizeof(sig)); - else - memset(&sig, 0, sizeof(sig)); + git_futils_file_stamp_set( + &stamp, file ? &file->cache_data.stamp : NULL); - error = load_attr_file(&content, &sig, filename); + error = load_attr_file(&content, &stamp, filename); } else { error = load_attr_blob_from_index(&content, &blob, repo, file ? &file->cache_data.oid : NULL, relfile); @@ -442,7 +440,7 @@ int git_attr_cache__push_file( if (blob) git_oid_cpy(&file->cache_data.oid, git_object_id((git_object *)blob)); else - memcpy(&file->cache_data.sig, &sig, sizeof(sig)); + git_futils_file_stamp_set(&file->cache_data.stamp, &stamp); finish: /* push file onto vector if we found one*/ |
