183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
i64 origSize = db_column_int64(&q, 6);
currentMtime = file_wd_mtime(0);
if( origSize!=file_wd_size(0) ){
/* A file size change is definitive - the file has changed. No
** need to check the sha1sum */
chnged = 1;
}
}
if( chnged!=1 && (checkMtime==0 || currentMtime!=oldMtime) ){
db_ephemeral_blob(&q, 5, &origCksum);
if( sha1sum_file(zName, &fileCksum) ){
blob_zero(&fileCksum);
}
if( blob_compare(&fileCksum, &origCksum) ){
chnged = 1;
}else if( currentMtime!=oldMtime ){
|
>
>
>
>
>
>
>
|
>
>
>
|
>
>
>
>
|
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
i64 origSize = db_column_int64(&q, 6);
currentMtime = file_wd_mtime(0);
if( origSize!=file_wd_size(0) ){
/* A file size change is definitive - the file has changed. No
** need to check the sha1sum */
chnged = 1;
}
}else if( chnged==1 && rid!=0 && !isDeleted ){
/* File is believed to have changed but it is the same size.
** Double check that it really has changed by looking at content. */
assert( origSize==currentSize );
db_ephemeral_blob(&q, 5, &origCksum);
if( sha1sum_file(zName, &fileCksum) ){
blob_zero(&fileCksum);
}
if( blob_compare(&fileCksum, &origCksum)==0 ) chnged = 0;
blob_reset(&origCksum);
blob_reset(&fileCksum);
}else if( chnged==0 && (useMtime==0 || currentMtime!=oldMtime) ){
/* For files that were formerly believed to be unchanged, if their
** mtime changes, or unconditionally if --sha1sum is used, check
** to see if they have been edited by looking at their SHA1 sum */
assert( origSize==currentSize );
db_ephemeral_blob(&q, 5, &origCksum);
if( sha1sum_file(zName, &fileCksum) ){
blob_zero(&fileCksum);
}
if( blob_compare(&fileCksum, &origCksum) ){
chnged = 1;
}else if( currentMtime!=oldMtime ){
|