MCPcopy Create free account
hub / github.com/git/git / validate_trailer_args

Function validate_trailer_args

trailer.c:778–805  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

776}
777
778int validate_trailer_args(const struct strvec *cli_args)
779{
780 char *cl_separators;
781 int ret = 0;
782
783 trailer_config_init();
784
785 cl_separators = xstrfmt("=%s", separators);
786
787 for (size_t i = 0; i < cli_args->nr; i++) {
788 const char *txt = cli_args->v[i];
789 ssize_t separator_pos;
790
791 if (!*txt) {
792 ret = error(_("empty --trailer argument"));
793 goto out;
794 }
795 separator_pos = find_separator(txt, cl_separators);
796 if (separator_pos == 0) {
797 ret = error(_("invalid trailer '%s': missing key before separator"),
798 txt);
799 goto out;
800 }
801 }
802out:
803 free(cl_separators);
804 return ret;
805}
806
807static const char *next_line(const char *str)
808{

Callers 2

amend_file_with_trailersFunction · 0.85
cmd_rebaseFunction · 0.85

Calls 4

trailer_config_initFunction · 0.85
xstrfmtFunction · 0.85
errorFunction · 0.85
find_separatorFunction · 0.85

Tested by

no test coverage detected