Fossil SCM
Unified diff now produces empty output when the diff is empty, insead of an empty wrapper element.
Commit
146e867eb5830e4e4df18cd3b22011d8e216b5fe61b08ab83889301af2c5643c
Parent
e7659e726596150…
1 file changed
+1
-1
+1
-1
| --- src/fileedit.c | ||
| +++ src/fileedit.c | ||
| @@ -982,11 +982,11 @@ | ||
| 982 | 982 | Blob out = empty_blob; |
| 983 | 983 | u64 diffFlags = DIFF_HTML | DIFF_NOTTOOBIG | DIFF_STRIP_EOLCR |
| 984 | 984 | | (isSbs ? DIFF_SIDEBYSIDE : DIFF_LINENO); |
| 985 | 985 | content_get(frid, &orig); |
| 986 | 986 | text_diff(&orig, pContent, &out, 0, diffFlags); |
| 987 | - if(isSbs){ | |
| 987 | + if(isSbs || blob_size(&out)==0){ | |
| 988 | 988 | CX("%b",&out); |
| 989 | 989 | }else{ |
| 990 | 990 | CX("<pre class='udiff'>%b</pre>",&out); |
| 991 | 991 | } |
| 992 | 992 | blob_reset(&orig); |
| 993 | 993 |
| --- src/fileedit.c | |
| +++ src/fileedit.c | |
| @@ -982,11 +982,11 @@ | |
| 982 | Blob out = empty_blob; |
| 983 | u64 diffFlags = DIFF_HTML | DIFF_NOTTOOBIG | DIFF_STRIP_EOLCR |
| 984 | | (isSbs ? DIFF_SIDEBYSIDE : DIFF_LINENO); |
| 985 | content_get(frid, &orig); |
| 986 | text_diff(&orig, pContent, &out, 0, diffFlags); |
| 987 | if(isSbs){ |
| 988 | CX("%b",&out); |
| 989 | }else{ |
| 990 | CX("<pre class='udiff'>%b</pre>",&out); |
| 991 | } |
| 992 | blob_reset(&orig); |
| 993 |
| --- src/fileedit.c | |
| +++ src/fileedit.c | |
| @@ -982,11 +982,11 @@ | |
| 982 | Blob out = empty_blob; |
| 983 | u64 diffFlags = DIFF_HTML | DIFF_NOTTOOBIG | DIFF_STRIP_EOLCR |
| 984 | | (isSbs ? DIFF_SIDEBYSIDE : DIFF_LINENO); |
| 985 | content_get(frid, &orig); |
| 986 | text_diff(&orig, pContent, &out, 0, diffFlags); |
| 987 | if(isSbs || blob_size(&out)==0){ |
| 988 | CX("%b",&out); |
| 989 | }else{ |
| 990 | CX("<pre class='udiff'>%b</pre>",&out); |
| 991 | } |
| 992 | blob_reset(&orig); |
| 993 |