@@ -1178,23 +1178,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
1178
1178
usage_with_options (builtin_merge_usage ,
1179
1179
builtin_merge_options );
1180
1180
1181
- /*
1182
- * This could be traditional "merge <msg> HEAD <commit>..." and
1183
- * the way we can tell it is to see if the second token is HEAD,
1184
- * but some people might have misused the interface and used a
1185
- * commit-ish that is the same as HEAD there instead.
1186
- * Traditional format never would have "-m" so it is an
1187
- * additional safety measure to check for it.
1188
- */
1189
-
1190
- if (!have_message && head_commit &&
1191
- is_old_style_invocation (argc , argv , head_commit -> object .sha1 )) {
1192
- strbuf_addstr (& merge_msg , argv [0 ]);
1193
- head_arg = argv [1 ];
1194
- argv += 2 ;
1195
- argc -= 2 ;
1196
- remoteheads = collect_parents (head_commit , & head_subsumed , argc , argv );
1197
- } else if (!head_commit ) {
1181
+ if (!head_commit ) {
1198
1182
struct commit * remote_head ;
1199
1183
/*
1200
1184
* If the merged head is a valid one there is no reason
@@ -1217,6 +1201,23 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
1217
1201
update_ref ("initial pull" , "HEAD" , remote_head -> object .sha1 ,
1218
1202
NULL , 0 , UPDATE_REFS_DIE_ON_ERR );
1219
1203
goto done ;
1204
+ }
1205
+
1206
+ /*
1207
+ * This could be traditional "merge <msg> HEAD <commit>..." and
1208
+ * the way we can tell it is to see if the second token is HEAD,
1209
+ * but some people might have misused the interface and used a
1210
+ * commit-ish that is the same as HEAD there instead.
1211
+ * Traditional format never would have "-m" so it is an
1212
+ * additional safety measure to check for it.
1213
+ */
1214
+ if (!have_message &&
1215
+ is_old_style_invocation (argc , argv , head_commit -> object .sha1 )) {
1216
+ strbuf_addstr (& merge_msg , argv [0 ]);
1217
+ head_arg = argv [1 ];
1218
+ argv += 2 ;
1219
+ argc -= 2 ;
1220
+ remoteheads = collect_parents (head_commit , & head_subsumed , argc , argv );
1220
1221
} else {
1221
1222
struct strbuf merge_names = STRBUF_INIT ;
1222
1223
0 commit comments