| 5217 | } |
| 5218 | |
| 5219 | int diff_check_follow_pathspec(struct pathspec *ps, int die_on_error) |
| 5220 | { |
| 5221 | unsigned forbidden_magic; |
| 5222 | |
| 5223 | if (ps->nr != 1) { |
| 5224 | if (die_on_error) |
| 5225 | die(_("--follow requires exactly one pathspec")); |
| 5226 | return 0; |
| 5227 | } |
| 5228 | |
| 5229 | forbidden_magic = ps->items[0].magic & ~(PATHSPEC_FROMTOP | |
| 5230 | PATHSPEC_LITERAL); |
| 5231 | if (forbidden_magic) { |
| 5232 | if (die_on_error) { |
| 5233 | struct strbuf sb = STRBUF_INIT; |
| 5234 | pathspec_magic_names(forbidden_magic, &sb); |
| 5235 | die(_("pathspec magic not supported by --follow: %s"), |
| 5236 | sb.buf); |
| 5237 | } |
| 5238 | return 0; |
| 5239 | } |
| 5240 | |
| 5241 | return 1; |
| 5242 | } |
| 5243 | |
| 5244 | void diff_setup_done(struct diff_options *options) |
| 5245 | { |
no test coverage detected