Fossil SCM
When adding a new artifact from a delta, read the delta header in order to insert the correct size into the blob table.
Commit
25e80d2e6efa8a713291bb29771cf19cdb88bd7e
Parent
24c33b00f2a9e32…
1 file changed
+8
-1
+8
-1
| --- src/content.c | ||
| +++ src/content.c | ||
| @@ -451,11 +451,18 @@ | ||
| 451 | 451 | assert( nBlob==0 ); |
| 452 | 452 | sha1sum_blob(pBlob, &hash); |
| 453 | 453 | }else{ |
| 454 | 454 | blob_init(&hash, zUuid, -1); |
| 455 | 455 | } |
| 456 | - size = nBlob ? nBlob : blob_size(pBlob); | |
| 456 | + if( nBlob ){ | |
| 457 | + size = nBlob; | |
| 458 | + }else{ | |
| 459 | + size = blob_size(pBlob); | |
| 460 | + if( srcId ){ | |
| 461 | + size = delta_output_size(blob_buffer(pBlob), size); | |
| 462 | + } | |
| 463 | + } | |
| 457 | 464 | db_begin_transaction(); |
| 458 | 465 | |
| 459 | 466 | /* Check to see if the entry already exists and if it does whether |
| 460 | 467 | ** or not the entry is a phantom |
| 461 | 468 | */ |
| 462 | 469 |
| --- src/content.c | |
| +++ src/content.c | |
| @@ -451,11 +451,18 @@ | |
| 451 | assert( nBlob==0 ); |
| 452 | sha1sum_blob(pBlob, &hash); |
| 453 | }else{ |
| 454 | blob_init(&hash, zUuid, -1); |
| 455 | } |
| 456 | size = nBlob ? nBlob : blob_size(pBlob); |
| 457 | db_begin_transaction(); |
| 458 | |
| 459 | /* Check to see if the entry already exists and if it does whether |
| 460 | ** or not the entry is a phantom |
| 461 | */ |
| 462 |
| --- src/content.c | |
| +++ src/content.c | |
| @@ -451,11 +451,18 @@ | |
| 451 | assert( nBlob==0 ); |
| 452 | sha1sum_blob(pBlob, &hash); |
| 453 | }else{ |
| 454 | blob_init(&hash, zUuid, -1); |
| 455 | } |
| 456 | if( nBlob ){ |
| 457 | size = nBlob; |
| 458 | }else{ |
| 459 | size = blob_size(pBlob); |
| 460 | if( srcId ){ |
| 461 | size = delta_output_size(blob_buffer(pBlob), size); |
| 462 | } |
| 463 | } |
| 464 | db_begin_transaction(); |
| 465 | |
| 466 | /* Check to see if the entry already exists and if it does whether |
| 467 | ** or not the entry is a phantom |
| 468 | */ |
| 469 |