@@ -44,7 +44,6 @@ struct strategy {
44
44
45
45
static const char * const builtin_merge_usage [] = {
46
46
N_ ("git merge [<options>] [<commit>...]" ),
47
- N_ ("git merge [<options>] <msg> HEAD <commit>" ),
48
47
N_ ("git merge --abort" ),
49
48
N_ ("git merge --continue" ),
50
49
NULL
@@ -634,9 +633,10 @@ static void write_tree_trivial(struct object_id *oid)
634
633
635
634
static int try_merge_strategy (const char * strategy , struct commit_list * common ,
636
635
struct commit_list * remoteheads ,
637
- struct commit * head , const char * head_arg )
636
+ struct commit * head )
638
637
{
639
638
static struct lock_file lock ;
639
+ const char * head_arg = "HEAD" ;
640
640
641
641
hold_locked_index (& lock , LOCK_DIE_ON_ERROR );
642
642
refresh_cache (REFRESH_QUIET );
@@ -853,24 +853,6 @@ static int suggest_conflicts(void)
853
853
return 1 ;
854
854
}
855
855
856
- static struct commit * is_old_style_invocation (int argc , const char * * argv ,
857
- const struct object_id * head )
858
- {
859
- struct commit * second_token = NULL ;
860
- if (argc > 2 ) {
861
- struct object_id second_oid ;
862
-
863
- if (get_oid (argv [1 ], & second_oid ))
864
- return NULL ;
865
- second_token = lookup_commit_reference_gently (second_oid .hash , 0 );
866
- if (!second_token )
867
- die (_ ("'%s' is not a commit" ), argv [1 ]);
868
- if (oidcmp (& second_token -> object .oid , head ))
869
- return NULL ;
870
- }
871
- return second_token ;
872
- }
873
-
874
856
static int evaluate_result (void )
875
857
{
876
858
int cnt = 0 ;
@@ -1120,7 +1102,6 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
1120
1102
struct object_id result_tree , stash , head_oid ;
1121
1103
struct commit * head_commit ;
1122
1104
struct strbuf buf = STRBUF_INIT ;
1123
- const char * head_arg ;
1124
1105
int i , ret = 0 , head_subsumed ;
1125
1106
int best_cnt = -1 , merge_was_ok = 0 , automerge_was_ok = 0 ;
1126
1107
struct commit_list * common = NULL ;
@@ -1260,34 +1241,12 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
1260
1241
}
1261
1242
1262
1243
/*
1263
- * This could be traditional "merge <msg> HEAD <commit>..." and
1264
- * the way we can tell it is to see if the second token is HEAD,
1265
- * but some people might have misused the interface and used a
1266
- * commit-ish that is the same as HEAD there instead.
1267
- * Traditional format never would have "-m" so it is an
1268
- * additional safety measure to check for it.
1244
+ * All the rest are the commits being merged; prepare
1245
+ * the standard merge summary message to be appended
1246
+ * to the given message.
1269
1247
*/
1270
- if (!have_message &&
1271
- is_old_style_invocation (argc , argv , & head_commit -> object .oid )) {
1272
- warning ("old-style 'git merge <msg> HEAD <commit>' is deprecated." );
1273
- strbuf_addstr (& merge_msg , argv [0 ]);
1274
- head_arg = argv [1 ];
1275
- argv += 2 ;
1276
- argc -= 2 ;
1277
- remoteheads = collect_parents (head_commit , & head_subsumed ,
1278
- argc , argv , NULL );
1279
- } else {
1280
- /* We are invoked directly as the first-class UI. */
1281
- head_arg = "HEAD" ;
1282
-
1283
- /*
1284
- * All the rest are the commits being merged; prepare
1285
- * the standard merge summary message to be appended
1286
- * to the given message.
1287
- */
1288
- remoteheads = collect_parents (head_commit , & head_subsumed ,
1289
- argc , argv , & merge_msg );
1290
- }
1248
+ remoteheads = collect_parents (head_commit , & head_subsumed ,
1249
+ argc , argv , & merge_msg );
1291
1250
1292
1251
if (!head_commit || !argc )
1293
1252
usage_with_options (builtin_merge_usage ,
@@ -1513,7 +1472,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
1513
1472
1514
1473
ret = try_merge_strategy (use_strategies [i ]-> name ,
1515
1474
common , remoteheads ,
1516
- head_commit , head_arg );
1475
+ head_commit );
1517
1476
if (!option_commit && !ret ) {
1518
1477
merge_was_ok = 1 ;
1519
1478
/*
@@ -1583,7 +1542,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
1583
1542
printf (_ ("Using the %s to prepare resolving by hand.\n" ),
1584
1543
best_strategy );
1585
1544
try_merge_strategy (best_strategy , common , remoteheads ,
1586
- head_commit , head_arg );
1545
+ head_commit );
1587
1546
}
1588
1547
1589
1548
if (squash )
0 commit comments