Fossil SCM
fix import handling of git repositories with renamed files Reported by James Cook in [forum:2b857ded1b]: renamed files were shown as a deletion and an addition. This was because the optional 3rd and 4th field in the manifest's F card to indicate renames were omitted, despite having parsed these data from the git fast-export marks.
Commit
7ab1e118503110495ff73f02163d3ffe1ab091bc40ad0292f0ffa53de62851d3
Parent
97ec767f4b3de68…
1 file changed
+7
-3
+7
-3
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -296,16 +296,20 @@ | ||
| 296 | 296 | for(i=0; i<gg.nFile; i++){ |
| 297 | 297 | const char *zUuid = gg.aFile[i].zUuid; |
| 298 | 298 | if( zUuid==0 ) continue; |
| 299 | 299 | blob_appendf(&record, "F %F %s", gg.aFile[i].zName, zUuid); |
| 300 | 300 | if( gg.aFile[i].isExe ){ |
| 301 | - blob_append(&record, " x\n", 3); | |
| 301 | + blob_append(&record, " x", 2); | |
| 302 | 302 | }else if( gg.aFile[i].isLink ){ |
| 303 | - blob_append(&record, " l\n", 3); | |
| 303 | + blob_append(&record, " l", 2); | |
| 304 | 304 | }else{ |
| 305 | - blob_append(&record, "\n", 1); | |
| 305 | + blob_append(&record, " w", 2); | |
| 306 | + } | |
| 307 | + if( gg.aFile[i].zPrior!=0 ){ | |
| 308 | + blob_appendf(&record, " %F", gg.aFile[i].zPrior); | |
| 306 | 309 | } |
| 310 | + blob_append(&record, "\n", 1); | |
| 307 | 311 | } |
| 308 | 312 | if( gg.zFrom ){ |
| 309 | 313 | blob_appendf(&record, "P %s", gg.zFrom); |
| 310 | 314 | for(i=0; i<gg.nMerge; i++){ |
| 311 | 315 | blob_appendf(&record, " %s", gg.azMerge[i]); |
| 312 | 316 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -296,16 +296,20 @@ | |
| 296 | for(i=0; i<gg.nFile; i++){ |
| 297 | const char *zUuid = gg.aFile[i].zUuid; |
| 298 | if( zUuid==0 ) continue; |
| 299 | blob_appendf(&record, "F %F %s", gg.aFile[i].zName, zUuid); |
| 300 | if( gg.aFile[i].isExe ){ |
| 301 | blob_append(&record, " x\n", 3); |
| 302 | }else if( gg.aFile[i].isLink ){ |
| 303 | blob_append(&record, " l\n", 3); |
| 304 | }else{ |
| 305 | blob_append(&record, "\n", 1); |
| 306 | } |
| 307 | } |
| 308 | if( gg.zFrom ){ |
| 309 | blob_appendf(&record, "P %s", gg.zFrom); |
| 310 | for(i=0; i<gg.nMerge; i++){ |
| 311 | blob_appendf(&record, " %s", gg.azMerge[i]); |
| 312 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -296,16 +296,20 @@ | |
| 296 | for(i=0; i<gg.nFile; i++){ |
| 297 | const char *zUuid = gg.aFile[i].zUuid; |
| 298 | if( zUuid==0 ) continue; |
| 299 | blob_appendf(&record, "F %F %s", gg.aFile[i].zName, zUuid); |
| 300 | if( gg.aFile[i].isExe ){ |
| 301 | blob_append(&record, " x", 2); |
| 302 | }else if( gg.aFile[i].isLink ){ |
| 303 | blob_append(&record, " l", 2); |
| 304 | }else{ |
| 305 | blob_append(&record, " w", 2); |
| 306 | } |
| 307 | if( gg.aFile[i].zPrior!=0 ){ |
| 308 | blob_appendf(&record, " %F", gg.aFile[i].zPrior); |
| 309 | } |
| 310 | blob_append(&record, "\n", 1); |
| 311 | } |
| 312 | if( gg.zFrom ){ |
| 313 | blob_appendf(&record, "P %s", gg.zFrom); |
| 314 | for(i=0; i<gg.nMerge; i++){ |
| 315 | blob_appendf(&record, " %s", gg.azMerge[i]); |
| 316 |