Fossil SCM
Improved detection of changes to a file after a merge that do not change the size of the file.
Commit
23022a8546d9fdc6bfb0560eb9c6b69db754b1c4
Parent
edc0c9464d3b316…
1 file changed
+6
-4
+6
-4
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -206,14 +206,16 @@ | ||
| 206 | 206 | blob_zero(&fileCksum); |
| 207 | 207 | } |
| 208 | 208 | if( blob_compare(&fileCksum, &origCksum)==0 ) chnged = 0; |
| 209 | 209 | blob_reset(&origCksum); |
| 210 | 210 | blob_reset(&fileCksum); |
| 211 | - }else if( chnged==0 && (useMtime==0 || currentMtime!=oldMtime) ){ | |
| 212 | - /* For files that were formerly believed to be unchanged, if their | |
| 213 | - ** mtime changes, or unconditionally if --sha1sum is used, check | |
| 214 | - ** to see if they have been edited by looking at their SHA1 sum */ | |
| 211 | + }else if( (chnged==0 || chnged==2) | |
| 212 | + && (useMtime==0 || currentMtime!=oldMtime) ){ | |
| 213 | + /* For files that were formerly believed to be unchanged or that were | |
| 214 | + ** changed by merging, if their mtime changes, or unconditionally | |
| 215 | + ** if --sha1sum is used, check to see if they have been edited by | |
| 216 | + ** looking at their SHA1 sum */ | |
| 215 | 217 | assert( origSize==currentSize ); |
| 216 | 218 | db_ephemeral_blob(&q, 5, &origCksum); |
| 217 | 219 | if( sha1sum_file(zName, &fileCksum) ){ |
| 218 | 220 | blob_zero(&fileCksum); |
| 219 | 221 | } |
| 220 | 222 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -206,14 +206,16 @@ | |
| 206 | blob_zero(&fileCksum); |
| 207 | } |
| 208 | if( blob_compare(&fileCksum, &origCksum)==0 ) chnged = 0; |
| 209 | blob_reset(&origCksum); |
| 210 | blob_reset(&fileCksum); |
| 211 | }else if( chnged==0 && (useMtime==0 || currentMtime!=oldMtime) ){ |
| 212 | /* For files that were formerly believed to be unchanged, if their |
| 213 | ** mtime changes, or unconditionally if --sha1sum is used, check |
| 214 | ** to see if they have been edited by looking at their SHA1 sum */ |
| 215 | assert( origSize==currentSize ); |
| 216 | db_ephemeral_blob(&q, 5, &origCksum); |
| 217 | if( sha1sum_file(zName, &fileCksum) ){ |
| 218 | blob_zero(&fileCksum); |
| 219 | } |
| 220 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -206,14 +206,16 @@ | |
| 206 | blob_zero(&fileCksum); |
| 207 | } |
| 208 | if( blob_compare(&fileCksum, &origCksum)==0 ) chnged = 0; |
| 209 | blob_reset(&origCksum); |
| 210 | blob_reset(&fileCksum); |
| 211 | }else if( (chnged==0 || chnged==2) |
| 212 | && (useMtime==0 || currentMtime!=oldMtime) ){ |
| 213 | /* For files that were formerly believed to be unchanged or that were |
| 214 | ** changed by merging, if their mtime changes, or unconditionally |
| 215 | ** if --sha1sum is used, check to see if they have been edited by |
| 216 | ** looking at their SHA1 sum */ |
| 217 | assert( origSize==currentSize ); |
| 218 | db_ephemeral_blob(&q, 5, &origCksum); |
| 219 | if( sha1sum_file(zName, &fileCksum) ){ |
| 220 | blob_zero(&fileCksum); |
| 221 | } |
| 222 |