]> git.ipfire.org Git - thirdparty/git.git/blobdiff - ref-filter.c
ref-filter: 'contents:trailers' show error if `:` is missing
[thirdparty/git.git] / ref-filter.c
index 8447cb09be0c2741b5a20426e6c0db104339fa7e..f6200196a3483b450c6dc3f6608029c42e024d2a 100644 (file)
@@ -342,9 +342,11 @@ static int contents_atom_parser(const struct ref_format *format, struct used_ato
                atom->u.contents.option = C_SIG;
        else if (!strcmp(arg, "subject"))
                atom->u.contents.option = C_SUB;
-       else if (skip_prefix(arg, "trailers", &arg)) {
-               skip_prefix(arg, ":", &arg);
-               if (trailers_atom_parser(format, atom, *arg ? arg : NULL, err))
+       else if (!strcmp(arg, "trailers")) {
+               if (trailers_atom_parser(format, atom, NULL, err))
+                       return -1;
+       } else if (skip_prefix(arg, "trailers:", &arg)) {
+               if (trailers_atom_parser(format, atom, arg, err))
                        return -1;
        } else if (skip_prefix(arg, "lines=", &arg)) {
                atom->u.contents.option = C_LINES;