Fossil SCM
Do not allow a merge into a closed leaf unless the --force option is used.
Commit
2cc7031dde4ed0896169094b142fc2657b784166cd2b247964190bb19764c2e3
Parent
2a88f7b3206ebb5…
1 file changed
+3
+3
| --- src/merge.c | ||
| +++ src/merge.c | ||
| @@ -402,10 +402,13 @@ | ||
| 402 | 402 | if( zBinGlob==0 ) zBinGlob = db_get("binary-glob",0); |
| 403 | 403 | vid = db_lget_int("checkout", 0); |
| 404 | 404 | if( vid==0 ){ |
| 405 | 405 | fossil_fatal("nothing is checked out"); |
| 406 | 406 | } |
| 407 | + if( forceFlag==0 && leaf_is_closed(vid) ){ | |
| 408 | + fossil_fatal("cannot merge into a closed leaf. Use --force to override"); | |
| 409 | + } | |
| 407 | 410 | if( !dryRunFlag ){ |
| 408 | 411 | if( autosync_loop(SYNC_PULL + SYNC_VERBOSE*verboseFlag, |
| 409 | 412 | db_get_int("autosync-tries", 1), 1) ){ |
| 410 | 413 | fossil_fatal("merge abandoned due to sync failure"); |
| 411 | 414 | } |
| 412 | 415 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -402,10 +402,13 @@ | |
| 402 | if( zBinGlob==0 ) zBinGlob = db_get("binary-glob",0); |
| 403 | vid = db_lget_int("checkout", 0); |
| 404 | if( vid==0 ){ |
| 405 | fossil_fatal("nothing is checked out"); |
| 406 | } |
| 407 | if( !dryRunFlag ){ |
| 408 | if( autosync_loop(SYNC_PULL + SYNC_VERBOSE*verboseFlag, |
| 409 | db_get_int("autosync-tries", 1), 1) ){ |
| 410 | fossil_fatal("merge abandoned due to sync failure"); |
| 411 | } |
| 412 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -402,10 +402,13 @@ | |
| 402 | if( zBinGlob==0 ) zBinGlob = db_get("binary-glob",0); |
| 403 | vid = db_lget_int("checkout", 0); |
| 404 | if( vid==0 ){ |
| 405 | fossil_fatal("nothing is checked out"); |
| 406 | } |
| 407 | if( forceFlag==0 && leaf_is_closed(vid) ){ |
| 408 | fossil_fatal("cannot merge into a closed leaf. Use --force to override"); |
| 409 | } |
| 410 | if( !dryRunFlag ){ |
| 411 | if( autosync_loop(SYNC_PULL + SYNC_VERBOSE*verboseFlag, |
| 412 | db_get_int("autosync-tries", 1), 1) ){ |
| 413 | fossil_fatal("merge abandoned due to sync failure"); |
| 414 | } |
| 415 |