Fossil SCM
When --no-prompt is being used and there is a branch name change during commit skip the prompt and the condition because it's not a fatal condition.
Commit
c552f440587e6652b33c114bff96ad844193fd7ddfc60d43fb7f8583a2e12942
Parent
82fee40e14cb487…
1 file changed
+4
-7
+4
-7
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -2724,20 +2724,17 @@ | ||
| 2724 | 2724 | */ |
| 2725 | 2725 | zNewBranch = branch_of_rid(vid); |
| 2726 | 2726 | if( fossil_strcmp(zCurBranch, zNewBranch)!=0 |
| 2727 | 2727 | && fossil_strcmp(sCiInfo.zBranch, zNewBranch)!=0 |
| 2728 | 2728 | && forceFlag==0 |
| 2729 | + && noPrompt==0 | |
| 2729 | 2730 | ){ |
| 2730 | 2731 | fossil_warning("parent check-in [%.10s] branch changed from '%s' to '%s'", |
| 2731 | 2732 | rid_to_uuid(vid), zCurBranch, zNewBranch); |
| 2732 | - if( !noPrompt ){ | |
| 2733 | - prompt_user("continue (y/N)? ", &ans); | |
| 2734 | - cReply = blob_str(&ans)[0]; | |
| 2735 | - blob_reset(&ans); | |
| 2736 | - }else{ | |
| 2737 | - cReply = 'N'; | |
| 2738 | - } | |
| 2733 | + prompt_user("continue (y/N)? ", &ans); | |
| 2734 | + cReply = blob_str(&ans)[0]; | |
| 2735 | + blob_reset(&ans); | |
| 2739 | 2736 | if( cReply!='y' && cReply!='Y' ){ |
| 2740 | 2737 | fossil_fatal("Abandoning commit because branch has changed"); |
| 2741 | 2738 | } |
| 2742 | 2739 | fossil_free(zCurBranch); |
| 2743 | 2740 | zCurBranch = branch_of_rid(vid); |
| 2744 | 2741 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -2724,20 +2724,17 @@ | |
| 2724 | */ |
| 2725 | zNewBranch = branch_of_rid(vid); |
| 2726 | if( fossil_strcmp(zCurBranch, zNewBranch)!=0 |
| 2727 | && fossil_strcmp(sCiInfo.zBranch, zNewBranch)!=0 |
| 2728 | && forceFlag==0 |
| 2729 | ){ |
| 2730 | fossil_warning("parent check-in [%.10s] branch changed from '%s' to '%s'", |
| 2731 | rid_to_uuid(vid), zCurBranch, zNewBranch); |
| 2732 | if( !noPrompt ){ |
| 2733 | prompt_user("continue (y/N)? ", &ans); |
| 2734 | cReply = blob_str(&ans)[0]; |
| 2735 | blob_reset(&ans); |
| 2736 | }else{ |
| 2737 | cReply = 'N'; |
| 2738 | } |
| 2739 | if( cReply!='y' && cReply!='Y' ){ |
| 2740 | fossil_fatal("Abandoning commit because branch has changed"); |
| 2741 | } |
| 2742 | fossil_free(zCurBranch); |
| 2743 | zCurBranch = branch_of_rid(vid); |
| 2744 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -2724,20 +2724,17 @@ | |
| 2724 | */ |
| 2725 | zNewBranch = branch_of_rid(vid); |
| 2726 | if( fossil_strcmp(zCurBranch, zNewBranch)!=0 |
| 2727 | && fossil_strcmp(sCiInfo.zBranch, zNewBranch)!=0 |
| 2728 | && forceFlag==0 |
| 2729 | && noPrompt==0 |
| 2730 | ){ |
| 2731 | fossil_warning("parent check-in [%.10s] branch changed from '%s' to '%s'", |
| 2732 | rid_to_uuid(vid), zCurBranch, zNewBranch); |
| 2733 | prompt_user("continue (y/N)? ", &ans); |
| 2734 | cReply = blob_str(&ans)[0]; |
| 2735 | blob_reset(&ans); |
| 2736 | if( cReply!='y' && cReply!='Y' ){ |
| 2737 | fossil_fatal("Abandoning commit because branch has changed"); |
| 2738 | } |
| 2739 | fossil_free(zCurBranch); |
| 2740 | zCurBranch = branch_of_rid(vid); |
| 2741 |