Fossil SCM
Do not show blank changes when doing a diff.
Commit
d5729c31b55eaeb7a7e2bea6627f28e071a81049
Parent
5ac4e151829333c…
1 file changed
+4
-2
+4
-2
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -66,12 +66,14 @@ | ||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /* Compute and output the differences */ |
| 69 | 69 | blob_zero(&out); |
| 70 | 70 | text_diff(pFile1, &file2, &out, 5, ignoreEolWs); |
| 71 | - printf("--- %s\n+++ %s\n", zName, zName2); | |
| 72 | - printf("%s\n", blob_str(&out)); | |
| 71 | + if( blob_size(&out) ){ | |
| 72 | + printf("--- %s\n+++ %s\n", zName, zName2); | |
| 73 | + printf("%s\n", blob_str(&out)); | |
| 74 | + } | |
| 73 | 75 | |
| 74 | 76 | /* Release memory resources */ |
| 75 | 77 | blob_reset(&file2); |
| 76 | 78 | blob_reset(&out); |
| 77 | 79 | }else{ |
| 78 | 80 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -66,12 +66,14 @@ | |
| 66 | } |
| 67 | |
| 68 | /* Compute and output the differences */ |
| 69 | blob_zero(&out); |
| 70 | text_diff(pFile1, &file2, &out, 5, ignoreEolWs); |
| 71 | printf("--- %s\n+++ %s\n", zName, zName2); |
| 72 | printf("%s\n", blob_str(&out)); |
| 73 | |
| 74 | /* Release memory resources */ |
| 75 | blob_reset(&file2); |
| 76 | blob_reset(&out); |
| 77 | }else{ |
| 78 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -66,12 +66,14 @@ | |
| 66 | } |
| 67 | |
| 68 | /* Compute and output the differences */ |
| 69 | blob_zero(&out); |
| 70 | text_diff(pFile1, &file2, &out, 5, ignoreEolWs); |
| 71 | if( blob_size(&out) ){ |
| 72 | printf("--- %s\n+++ %s\n", zName, zName2); |
| 73 | printf("%s\n", blob_str(&out)); |
| 74 | } |
| 75 | |
| 76 | /* Release memory resources */ |
| 77 | blob_reset(&file2); |
| 78 | blob_reset(&out); |
| 79 | }else{ |
| 80 |