Fossil SCM
After fossil rm, do not read content from disk with fossil diff. This way, fossil diff output reflects what would be committed.
Commit
e93797317ddcc568ed739a72906c040ca5b7a894124189278099114d02188db1
Parent
200dcdcd37f97c6…
1 file changed
+5
-2
+5
-2
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -441,11 +441,11 @@ | ||
| 441 | 441 | Blob file2; /* Content of zFile2 */ |
| 442 | 442 | const char *zName2; /* Name of zFile2 for display */ |
| 443 | 443 | |
| 444 | 444 | /* Read content of zFile2 into memory */ |
| 445 | 445 | blob_zero(&file2); |
| 446 | - if( file_size(zFile2, ExtFILE)<0 ){ | |
| 446 | + if( pCfg->diffFlags & DIFF_FILE_DELETED || file_size(zFile2, ExtFILE)<0 ){ | |
| 447 | 447 | zName2 = NULL_DEVICE; |
| 448 | 448 | }else{ |
| 449 | 449 | blob_read_from_file(&file2, zFile2, ExtFILE); |
| 450 | 450 | zName2 = zName; |
| 451 | 451 | } |
| @@ -754,11 +754,14 @@ | ||
| 754 | 754 | if( srcid>0 ){ |
| 755 | 755 | content_get(srcid, &content); |
| 756 | 756 | }else{ |
| 757 | 757 | blob_zero(&content); |
| 758 | 758 | } |
| 759 | - if( isChnged==0 || !file_same_as_blob(&content, zFullName) ){ | |
| 759 | + if( isChnged==0 | |
| 760 | + || pCfg->diffFlags & DIFF_FILE_DELETED | |
| 761 | + || !file_same_as_blob(&content, zFullName) | |
| 762 | + ){ | |
| 760 | 763 | diff_print_index(zPathname, pCfg, pOut); |
| 761 | 764 | diff_file(&content, zFullName, zPathname, pCfg, pOut); |
| 762 | 765 | } |
| 763 | 766 | blob_reset(&content); |
| 764 | 767 | } |
| 765 | 768 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -441,11 +441,11 @@ | |
| 441 | Blob file2; /* Content of zFile2 */ |
| 442 | const char *zName2; /* Name of zFile2 for display */ |
| 443 | |
| 444 | /* Read content of zFile2 into memory */ |
| 445 | blob_zero(&file2); |
| 446 | if( file_size(zFile2, ExtFILE)<0 ){ |
| 447 | zName2 = NULL_DEVICE; |
| 448 | }else{ |
| 449 | blob_read_from_file(&file2, zFile2, ExtFILE); |
| 450 | zName2 = zName; |
| 451 | } |
| @@ -754,11 +754,14 @@ | |
| 754 | if( srcid>0 ){ |
| 755 | content_get(srcid, &content); |
| 756 | }else{ |
| 757 | blob_zero(&content); |
| 758 | } |
| 759 | if( isChnged==0 || !file_same_as_blob(&content, zFullName) ){ |
| 760 | diff_print_index(zPathname, pCfg, pOut); |
| 761 | diff_file(&content, zFullName, zPathname, pCfg, pOut); |
| 762 | } |
| 763 | blob_reset(&content); |
| 764 | } |
| 765 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -441,11 +441,11 @@ | |
| 441 | Blob file2; /* Content of zFile2 */ |
| 442 | const char *zName2; /* Name of zFile2 for display */ |
| 443 | |
| 444 | /* Read content of zFile2 into memory */ |
| 445 | blob_zero(&file2); |
| 446 | if( pCfg->diffFlags & DIFF_FILE_DELETED || file_size(zFile2, ExtFILE)<0 ){ |
| 447 | zName2 = NULL_DEVICE; |
| 448 | }else{ |
| 449 | blob_read_from_file(&file2, zFile2, ExtFILE); |
| 450 | zName2 = zName; |
| 451 | } |
| @@ -754,11 +754,14 @@ | |
| 754 | if( srcid>0 ){ |
| 755 | content_get(srcid, &content); |
| 756 | }else{ |
| 757 | blob_zero(&content); |
| 758 | } |
| 759 | if( isChnged==0 |
| 760 | || pCfg->diffFlags & DIFF_FILE_DELETED |
| 761 | || !file_same_as_blob(&content, zFullName) |
| 762 | ){ |
| 763 | diff_print_index(zPathname, pCfg, pOut); |
| 764 | diff_file(&content, zFullName, zPathname, pCfg, pOut); |
| 765 | } |
| 766 | blob_reset(&content); |
| 767 | } |
| 768 |