Index: delta_diff_generator.cc |
diff --git a/delta_diff_generator.cc b/delta_diff_generator.cc |
index ccdf27ad5ce56341ccbfde8ac0bc5299a5f0da7a..82bce8a5ca024ab728414e5dfc625370e6aed3a3 100644 |
--- a/delta_diff_generator.cc |
+++ b/delta_diff_generator.cc |
@@ -169,11 +169,11 @@ bool DeltaReadFiles(Graph* graph, |
// from using a graph/cycle detection/etc to generate diffs, and at that |
// time, it will be easy (non-complex) to have many operations read |
// from the same source blocks. At that time, this code can die. -adlr |
- bool should_diff_from_source = true; |
+ bool should_diff_from_source = false; |
string src_path = old_root + fs_iter.GetPartialPath(); |
- if (utils::FileExists(src_path.c_str())) { |
- struct stat src_stbuf; |
- TEST_AND_RETURN_FALSE_ERRNO(0 == stat(src_path.c_str(), &src_stbuf)); |
+ struct stat src_stbuf; |
petkov
2011/02/22 20:04:04
so, if a symlink in the src image is replaced by a
adlr
2011/02/22 23:21:48
Yeah, symlinks could point to bunk data (imagine a
|
+ if (0 == lstat(src_path.c_str(), &src_stbuf) && |
petkov
2011/02/22 20:04:04
There's a utils::IsSymlink utility... You could ad
adlr
2011/02/22 23:21:48
I went to do that, then realized I need to get the
|
+ S_ISREG(src_stbuf.st_mode)) { |
should_diff_from_source = !utils::SetContainsKey(visited_src_inodes, |
src_stbuf.st_ino); |
visited_src_inodes.insert(src_stbuf.st_ino); |