Skip to content

Commit b6d2558

Browse files
hanwengitster
authored andcommitted
builtin/commit: suggest update-ref for pseudoref removal
When pseudorefs move to a different ref storage mechanism, pseudorefs no longer can be removed with 'rm'. Instead, suggest a "update-ref -d" command, which will work regardless of ref storage backend. Signed-off-by: Han-Wen Nienhuys <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c8e4159 commit b6d2558

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

builtin/commit.c

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -847,21 +847,19 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
847847
if (cleanup_mode == COMMIT_MSG_CLEANUP_SCISSORS &&
848848
!merge_contains_scissors)
849849
wt_status_add_cut_line(s->fp);
850-
status_printf_ln(s, GIT_COLOR_NORMAL,
851-
whence == FROM_MERGE
852-
? _("\n"
853-
"It looks like you may be committing a merge.\n"
854-
"If this is not correct, please remove the file\n"
855-
" %s\n"
856-
"and try again.\n")
857-
: _("\n"
858-
"It looks like you may be committing a cherry-pick.\n"
859-
"If this is not correct, please remove the file\n"
860-
" %s\n"
861-
"and try again.\n"),
850+
status_printf_ln(
851+
s, GIT_COLOR_NORMAL,
862852
whence == FROM_MERGE ?
863-
git_path_merge_head(the_repository) :
864-
git_path_cherry_pick_head(the_repository));
853+
_("\n"
854+
"It looks like you may be committing a merge.\n"
855+
"If this is not correct, please run\n"
856+
" git update-ref -d MERGE_HEAD\n"
857+
"and try again.\n") :
858+
_("\n"
859+
"It looks like you may be committing a cherry-pick.\n"
860+
"If this is not correct, please run\n"
861+
" git update-ref -d CHERRY_PICK_HEAD\n"
862+
"and try again.\n"));
865863
}
866864

867865
fprintf(s->fp, "\n");

0 commit comments

Comments
 (0)