Fossil SCM
Avoid entering a ticket-change artifact that does not specify any changes.
Commit
7097562813f763f475fe1c7d7f7687a82221aba2
Parent
a758144e2688346…
1 file changed
+6
+6
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -433,10 +433,11 @@ | ||
| 433 | 433 | ){ |
| 434 | 434 | char *zDate; |
| 435 | 435 | const char *zUuid; |
| 436 | 436 | int i; |
| 437 | 437 | int rid; |
| 438 | + int nJ = 0; | |
| 438 | 439 | Blob tktchng, cksum; |
| 439 | 440 | |
| 440 | 441 | login_verify_csrf_secret(); |
| 441 | 442 | zUuid = (const char *)pUuid; |
| 442 | 443 | blob_zero(&tktchng); |
| @@ -461,10 +462,11 @@ | ||
| 461 | 462 | zValue = db_conceal(zValue, nValue); |
| 462 | 463 | blob_appendf(&tktchng, "J %s %s\n", azField[i], zValue); |
| 463 | 464 | }else{ |
| 464 | 465 | blob_appendf(&tktchng, "J %s %#F\n", azField[i], nValue, zValue); |
| 465 | 466 | } |
| 467 | + nJ++; | |
| 466 | 468 | } |
| 467 | 469 | } |
| 468 | 470 | } |
| 469 | 471 | if( *(char**)pUuid ){ |
| 470 | 472 | zUuid = db_text(0, |
| @@ -476,10 +478,14 @@ | ||
| 476 | 478 | *(const char**)pUuid = zUuid; |
| 477 | 479 | blob_appendf(&tktchng, "K %s\n", zUuid); |
| 478 | 480 | blob_appendf(&tktchng, "U %F\n", g.zLogin ? g.zLogin : ""); |
| 479 | 481 | md5sum_blob(&tktchng, &cksum); |
| 480 | 482 | blob_appendf(&tktchng, "Z %b\n", &cksum); |
| 483 | + if( nJ==0 ){ | |
| 484 | + blob_reset(&tktchng); | |
| 485 | + return TH_OK; | |
| 486 | + } | |
| 481 | 487 | if( g.zPath[0]=='d' ){ |
| 482 | 488 | /* If called from /debug_tktnew or /debug_tktedit... */ |
| 483 | 489 | @ <font color="blue"> |
| 484 | 490 | @ <p>Ticket artifact that would have been submitted:</p> |
| 485 | 491 | @ <blockquote><pre>%h(blob_str(&tktchng))</pre></blockquote> |
| 486 | 492 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -433,10 +433,11 @@ | |
| 433 | ){ |
| 434 | char *zDate; |
| 435 | const char *zUuid; |
| 436 | int i; |
| 437 | int rid; |
| 438 | Blob tktchng, cksum; |
| 439 | |
| 440 | login_verify_csrf_secret(); |
| 441 | zUuid = (const char *)pUuid; |
| 442 | blob_zero(&tktchng); |
| @@ -461,10 +462,11 @@ | |
| 461 | zValue = db_conceal(zValue, nValue); |
| 462 | blob_appendf(&tktchng, "J %s %s\n", azField[i], zValue); |
| 463 | }else{ |
| 464 | blob_appendf(&tktchng, "J %s %#F\n", azField[i], nValue, zValue); |
| 465 | } |
| 466 | } |
| 467 | } |
| 468 | } |
| 469 | if( *(char**)pUuid ){ |
| 470 | zUuid = db_text(0, |
| @@ -476,10 +478,14 @@ | |
| 476 | *(const char**)pUuid = zUuid; |
| 477 | blob_appendf(&tktchng, "K %s\n", zUuid); |
| 478 | blob_appendf(&tktchng, "U %F\n", g.zLogin ? g.zLogin : ""); |
| 479 | md5sum_blob(&tktchng, &cksum); |
| 480 | blob_appendf(&tktchng, "Z %b\n", &cksum); |
| 481 | if( g.zPath[0]=='d' ){ |
| 482 | /* If called from /debug_tktnew or /debug_tktedit... */ |
| 483 | @ <font color="blue"> |
| 484 | @ <p>Ticket artifact that would have been submitted:</p> |
| 485 | @ <blockquote><pre>%h(blob_str(&tktchng))</pre></blockquote> |
| 486 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -433,10 +433,11 @@ | |
| 433 | ){ |
| 434 | char *zDate; |
| 435 | const char *zUuid; |
| 436 | int i; |
| 437 | int rid; |
| 438 | int nJ = 0; |
| 439 | Blob tktchng, cksum; |
| 440 | |
| 441 | login_verify_csrf_secret(); |
| 442 | zUuid = (const char *)pUuid; |
| 443 | blob_zero(&tktchng); |
| @@ -461,10 +462,11 @@ | |
| 462 | zValue = db_conceal(zValue, nValue); |
| 463 | blob_appendf(&tktchng, "J %s %s\n", azField[i], zValue); |
| 464 | }else{ |
| 465 | blob_appendf(&tktchng, "J %s %#F\n", azField[i], nValue, zValue); |
| 466 | } |
| 467 | nJ++; |
| 468 | } |
| 469 | } |
| 470 | } |
| 471 | if( *(char**)pUuid ){ |
| 472 | zUuid = db_text(0, |
| @@ -476,10 +478,14 @@ | |
| 478 | *(const char**)pUuid = zUuid; |
| 479 | blob_appendf(&tktchng, "K %s\n", zUuid); |
| 480 | blob_appendf(&tktchng, "U %F\n", g.zLogin ? g.zLogin : ""); |
| 481 | md5sum_blob(&tktchng, &cksum); |
| 482 | blob_appendf(&tktchng, "Z %b\n", &cksum); |
| 483 | if( nJ==0 ){ |
| 484 | blob_reset(&tktchng); |
| 485 | return TH_OK; |
| 486 | } |
| 487 | if( g.zPath[0]=='d' ){ |
| 488 | /* If called from /debug_tktnew or /debug_tktedit... */ |
| 489 | @ <font color="blue"> |
| 490 | @ <p>Ticket artifact that would have been submitted:</p> |
| 491 | @ <blockquote><pre>%h(blob_str(&tktchng))</pre></blockquote> |
| 492 |