@matheusbsbs / matheus-bagliano / commits / b6d2558c9e
Fork 0

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 <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Han-Wen Nienhuys committed Aug 21, 2020 at 16:59 UTC b6d2558c9ea37382078635022f8932565bea8ca1
1 file changed +12 -14
builtin/commit.c
+12 -14
@@ -847,21 +847,19 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
847 if (cleanup_mode == COMMIT_MSG_CLEANUP_SCISSORS &&
848 !merge_contains_scissors)
849 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,
852 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"));
863 }
864
865 fprintf(s->fp, "\n");