projects
/
cumulus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add support for octal and hexadecimal output in dumps.
[cumulus.git]
/
statcache.cc
diff --git
a/statcache.cc
b/statcache.cc
index
376c099
..
86886c0
100644
(file)
--- a/
statcache.cc
+++ b/
statcache.cc
@@
-30,9
+30,9
@@
#include <map>
#include <string>
#include <map>
#include <string>
-#include "format.h"
#include "ref.h"
#include "statcache.h"
#include "ref.h"
#include "statcache.h"
+#include "util.h"
using std::list;
using std::map;
using std::list;
using std::map;
@@
-121,15
+121,17
@@
void StatCache::ReadNext()
old_mtime = -1;
old_ctime = -1;
old_inode = -1;
old_mtime = -1;
old_ctime = -1;
old_inode = -1;
+ old_size = -1;
old_checksum = "";
old_contents.clear();
old_checksum = "";
old_contents.clear();
- /* First, read in the filename.
TODO: Unescaping.
*/
+ /* First, read in the filename. */
getline(cache, old_name);
if (!cache) {
end_of_cache = true;
return;
}
getline(cache, old_name);
if (!cache) {
end_of_cache = true;
return;
}
+ old_name = uri_decode(old_name);
/* Start reading in the fields which follow the filename. */
string field = "";
/* Start reading in the fields which follow the filename. */
string field = "";
@@
-171,6
+173,8
@@
void StatCache::ReadNext()
old_ctime = parse_int(fields["ctime"]);
if (fields.count("inode"))
old_inode = parse_int(fields["inode"]);
old_ctime = parse_int(fields["ctime"]);
if (fields.count("inode"))
old_inode = parse_int(fields["inode"]);
+ if (fields.count("size"))
+ old_size = parse_int(fields["size"]);
old_checksum = fields["checksum"];
old_checksum = fields["checksum"];
@@
-225,6
+229,8
@@
bool StatCache::Find(const string &path, const struct stat *stat_buf)
return false;
if ((long long)stat_buf->st_ino != old_inode)
return false;
return false;
if ((long long)stat_buf->st_ino != old_inode)
return false;
+ if (stat_buf->st_size != old_size)
+ return false;
/* File looks to be unchanged. */
return true;
/* File looks to be unchanged. */
return true;