MCPcopy Create free account
hub / github.com/git/git / diff_check_follow_pathspec

Function diff_check_follow_pathspec

diff.c:5219–5242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5217}
5218
5219int 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
5244void diff_setup_done(struct diff_options *options)
5245{

Callers 2

diff_setup_doneFunction · 0.85

Calls 2

pathspec_magic_namesFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected