} u;
 } *used_atom;
 static int used_atom_cnt, need_tagged, need_symref;
-static int need_color_reset_at_eol;
 
 static void color_atom_parser(struct used_atom *atom, const char *color_value)
 {
 {
        const char *cp, *sp;
 
-       need_color_reset_at_eol = 0;
+       format->need_color_reset_at_eol = 0;
        for (cp = format->format; *cp && (sp = find_next(cp)); ) {
                const char *color, *ep = strchr(sp, ')');
                int at;
                cp = ep + 1;
 
                if (skip_prefix(used_atom[at].name, "color:", &color))
-                       need_color_reset_at_eol = !!strcmp(color, "reset");
+                       format->need_color_reset_at_eol = !!strcmp(color, "reset");
        }
        return 0;
 }
                sp = cp + strlen(cp);
                append_literal(cp, sp, &state);
        }
-       if (need_color_reset_at_eol) {
+       if (format->need_color_reset_at_eol) {
                struct atom_value resetv;
                resetv.s = GIT_COLOR_RESET;
                append_atom(&resetv, &state);
 
         */
        const char *format;
        int quote_style;
+
+       /* Internal state to ref-filter */
+       int need_color_reset_at_eol;
 };
 
 #define REF_FORMAT_INIT { NULL, 0 }