Fossil SCM

Do not allow a merge into a closed leaf unless the --force option is used.

drh 2021-05-21 17:58 trunk
Commit 2cc7031dde4ed0896169094b142fc2657b784166cd2b247964190bb19764c2e3
1 file changed +3
--- src/merge.c
+++ src/merge.c
@@ -402,10 +402,13 @@
402402
if( zBinGlob==0 ) zBinGlob = db_get("binary-glob",0);
403403
vid = db_lget_int("checkout", 0);
404404
if( vid==0 ){
405405
fossil_fatal("nothing is checked out");
406406
}
407
+ if( forceFlag==0 && leaf_is_closed(vid) ){
408
+ fossil_fatal("cannot merge into a closed leaf. Use --force to override");
409
+ }
407410
if( !dryRunFlag ){
408411
if( autosync_loop(SYNC_PULL + SYNC_VERBOSE*verboseFlag,
409412
db_get_int("autosync-tries", 1), 1) ){
410413
fossil_fatal("merge abandoned due to sync failure");
411414
}
412415
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button