@@ -1021,8 +1021,15 @@ int verify_ref_format(struct ref_format *format)
if (at < 0)
die("%s", err.buf);
- if (used_atom[at].atom_type == ATOM_REST)
- die("this command reject atom %%(%.*s)", (int)(ep - sp - 2), sp + 2);
+ if ((!format->cat_file_mode && used_atom[at].atom_type == ATOM_REST) ||
+ (format->cat_file_mode && (used_atom[at].atom_type == ATOM_FLAG ||
+ used_atom[at].atom_type == ATOM_HEAD ||
+ used_atom[at].atom_type == ATOM_PUSH ||
+ used_atom[at].atom_type == ATOM_REFNAME ||
+ used_atom[at].atom_type == ATOM_SYMREF ||
+ used_atom[at].atom_type == ATOM_UPSTREAM ||
+ used_atom[at].atom_type == ATOM_WORKTREEPATH)))
+ die(_("this command reject atom %%(%.*s)"), (int)(ep - sp - 2), sp + 2);
if ((format->quote_style == QUOTE_PYTHON ||
format->quote_style == QUOTE_SHELL ||
@@ -78,6 +78,7 @@ struct ref_format {
*/
const char *format;
const char *rest;
+ int cat_file_mode;
int quote_style;
int use_rest;
int use_color;