@@ -42,7 +42,6 @@ struct strategy {
42
42
43
43
static const char * const builtin_merge_usage [] = {
44
44
N_ ("git merge [options] [<commit>...]" ),
45
- N_ ("git merge [options] <msg> HEAD <commit>" ),
46
45
N_ ("git merge --abort" ),
47
46
NULL
48
47
};
@@ -633,9 +632,10 @@ static void write_tree_trivial(unsigned char *sha1)
633
632
634
633
static int try_merge_strategy (const char * strategy , struct commit_list * common ,
635
634
struct commit_list * remoteheads ,
636
- struct commit * head , const char * head_arg )
635
+ struct commit * head )
637
636
{
638
637
static struct lock_file lock ;
638
+ const char * head_arg = "HEAD" ;
639
639
640
640
hold_locked_index (& lock , 1 );
641
641
refresh_cache (REFRESH_QUIET );
@@ -887,24 +887,6 @@ static int suggest_conflicts(int renormalizing)
887
887
return 1 ;
888
888
}
889
889
890
- static struct commit * is_old_style_invocation (int argc , const char * * argv ,
891
- const unsigned char * head )
892
- {
893
- struct commit * second_token = NULL ;
894
- if (argc > 2 ) {
895
- unsigned char second_sha1 [20 ];
896
-
897
- if (get_sha1 (argv [1 ], second_sha1 ))
898
- return NULL ;
899
- second_token = lookup_commit_reference_gently (second_sha1 , 0 );
900
- if (!second_token )
901
- die (_ ("'%s' is not a commit" ), argv [1 ]);
902
- if (hashcmp (second_token -> object .sha1 , head ))
903
- return NULL ;
904
- }
905
- return second_token ;
906
- }
907
-
908
890
static int evaluate_result (void )
909
891
{
910
892
int cnt = 0 ;
@@ -1172,7 +1154,6 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
1172
1154
unsigned char head_sha1 [20 ];
1173
1155
struct commit * head_commit ;
1174
1156
struct strbuf buf = STRBUF_INIT ;
1175
- const char * head_arg ;
1176
1157
int flag , i , ret = 0 , head_subsumed ;
1177
1158
int best_cnt = -1 , merge_was_ok = 0 , automerge_was_ok = 0 ;
1178
1159
struct commit_list * common = NULL ;
@@ -1290,34 +1271,12 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
1290
1271
}
1291
1272
1292
1273
/*
1293
- * This could be traditional "merge <msg> HEAD <commit>..." and
1294
- * the way we can tell it is to see if the second token is HEAD,
1295
- * but some people might have misused the interface and used a
1296
- * commit-ish that is the same as HEAD there instead.
1297
- * Traditional format never would have "-m" so it is an
1298
- * additional safety measure to check for it.
1274
+ * All the rest are the commits being merged; prepare
1275
+ * the standard merge summary message to be appended
1276
+ * to the given message.
1299
1277
*/
1300
- if (!have_message &&
1301
- is_old_style_invocation (argc , argv , head_commit -> object .sha1 )) {
1302
- warning ("old-style 'git merge <msg> HEAD <commit>' is deprecated." );
1303
- strbuf_addstr (& merge_msg , argv [0 ]);
1304
- head_arg = argv [1 ];
1305
- argv += 2 ;
1306
- argc -= 2 ;
1307
- remoteheads = collect_parents (head_commit , & head_subsumed ,
1308
- argc , argv , NULL );
1309
- } else {
1310
- /* We are invoked directly as the first-class UI. */
1311
- head_arg = "HEAD" ;
1312
-
1313
- /*
1314
- * All the rest are the commits being merged; prepare
1315
- * the standard merge summary message to be appended
1316
- * to the given message.
1317
- */
1318
- remoteheads = collect_parents (head_commit , & head_subsumed ,
1319
- argc , argv , & merge_msg );
1320
- }
1278
+ remoteheads = collect_parents (head_commit , & head_subsumed ,
1279
+ argc , argv , & merge_msg );
1321
1280
1322
1281
if (!head_commit || !argc )
1323
1282
usage_with_options (builtin_merge_usage ,
@@ -1542,7 +1501,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
1542
1501
1543
1502
ret = try_merge_strategy (use_strategies [i ]-> name ,
1544
1503
common , remoteheads ,
1545
- head_commit , head_arg );
1504
+ head_commit );
1546
1505
if (!option_commit && !ret ) {
1547
1506
merge_was_ok = 1 ;
1548
1507
/*
@@ -1612,7 +1571,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
1612
1571
printf (_ ("Using the %s to prepare resolving by hand.\n" ),
1613
1572
best_strategy );
1614
1573
try_merge_strategy (best_strategy , common , remoteheads ,
1615
- head_commit , head_arg );
1574
+ head_commit );
1616
1575
}
1617
1576
1618
1577
if (squash )
0 commit comments