| 1964 | } |
| 1965 | |
| 1966 | void userformat_find_requirements(const char *fmt, struct userformat_want *w) |
| 1967 | { |
| 1968 | if (!fmt) { |
| 1969 | if (!user_format) |
| 1970 | return; |
| 1971 | fmt = user_format; |
| 1972 | } |
| 1973 | while ((fmt = strchr(fmt, '%'))) { |
| 1974 | fmt++; |
| 1975 | if (skip_prefix(fmt, "%", &fmt)) |
| 1976 | continue; |
| 1977 | |
| 1978 | if (*fmt == '+' || *fmt == '-' || *fmt == ' ') |
| 1979 | fmt++; |
| 1980 | |
| 1981 | switch (*fmt) { |
| 1982 | case 'N': |
| 1983 | w->notes = 1; |
| 1984 | break; |
| 1985 | case 'S': |
| 1986 | w->source = 1; |
| 1987 | break; |
| 1988 | case 'd': |
| 1989 | case 'D': |
| 1990 | w->decorate = 1; |
| 1991 | break; |
| 1992 | case '(': |
| 1993 | if (starts_with(fmt + 1, "decorate")) |
| 1994 | w->decorate = 1; |
| 1995 | break; |
| 1996 | } |
| 1997 | } |
| 1998 | } |
| 1999 | |
| 2000 | void repo_format_commit_message(struct repository *r, |
| 2001 | const struct commit *commit, |
no test coverage detected