@@ -943,6 +943,7 @@ N_("you have staged changes in your working tree\n"
943
943
#define CLEANUP_MSG (1<<3)
944
944
#define VERIFY_MSG (1<<4)
945
945
#define CREATE_ROOT_COMMIT (1<<5)
946
+ #define VERBATIM_MSG (1<<6)
946
947
947
948
static int run_command_silent_on_success (struct child_process * cmd )
948
949
{
@@ -979,6 +980,9 @@ static int run_git_commit(const char *defmsg,
979
980
{
980
981
struct child_process cmd = CHILD_PROCESS_INIT ;
981
982
983
+ if ((flags & CLEANUP_MSG ) && (flags & VERBATIM_MSG ))
984
+ BUG ("CLEANUP_MSG and VERBATIM_MSG are mutually exclusive" );
985
+
982
986
cmd .git_cmd = 1 ;
983
987
984
988
if (is_rebase_i (opts ) && read_env_script (& cmd .env_array )) {
@@ -1012,6 +1016,8 @@ static int run_git_commit(const char *defmsg,
1012
1016
strvec_pushl (& cmd .args , "-C" , "HEAD" , NULL );
1013
1017
if ((flags & CLEANUP_MSG ))
1014
1018
strvec_push (& cmd .args , "--cleanup=strip" );
1019
+ if ((flags & VERBATIM_MSG ))
1020
+ strvec_push (& cmd .args , "--cleanup=verbatim" );
1015
1021
if ((flags & EDIT_MSG ))
1016
1022
strvec_push (& cmd .args , "-e" );
1017
1023
else if (!(flags & CLEANUP_MSG ) &&
@@ -1380,6 +1386,9 @@ static int try_to_commit(struct repository *r,
1380
1386
enum commit_msg_cleanup_mode cleanup ;
1381
1387
int res = 0 ;
1382
1388
1389
+ if ((flags & CLEANUP_MSG ) && (flags & VERBATIM_MSG ))
1390
+ BUG ("CLEANUP_MSG and VERBATIM_MSG are mutually exclusive" );
1391
+
1383
1392
if (parse_head (r , & current_head ))
1384
1393
return -1 ;
1385
1394
@@ -1454,6 +1463,8 @@ static int try_to_commit(struct repository *r,
1454
1463
1455
1464
if (flags & CLEANUP_MSG )
1456
1465
cleanup = COMMIT_MSG_CLEANUP_ALL ;
1466
+ else if (flags & VERBATIM_MSG )
1467
+ cleanup = COMMIT_MSG_CLEANUP_NONE ;
1457
1468
else if ((opts -> signoff || opts -> record_origin ) &&
1458
1469
!opts -> explicit_cleanup )
1459
1470
cleanup = COMMIT_MSG_CLEANUP_SPACE ;
@@ -2002,7 +2013,7 @@ static int do_pick_commit(struct repository *r,
2002
2013
if (!final_fixup )
2003
2014
msg_file = rebase_path_squash_msg ();
2004
2015
else if (file_exists (rebase_path_fixup_msg ())) {
2005
- flags |= CLEANUP_MSG ;
2016
+ flags |= VERBATIM_MSG ;
2006
2017
msg_file = rebase_path_fixup_msg ();
2007
2018
} else {
2008
2019
const char * dest = git_path_squash_msg (r );
0 commit comments