| 5242 | } |
| 5243 | |
| 5244 | void diff_setup_done(struct diff_options *options) |
| 5245 | { |
| 5246 | unsigned check_mask = DIFF_FORMAT_NAME | |
| 5247 | DIFF_FORMAT_NAME_STATUS | |
| 5248 | DIFF_FORMAT_CHECKDIFF | |
| 5249 | DIFF_FORMAT_NO_OUTPUT; |
| 5250 | /* |
| 5251 | * This must be signed because we're comparing against a potentially |
| 5252 | * negative value. |
| 5253 | */ |
| 5254 | const int hexsz = the_hash_algo->hexsz; |
| 5255 | |
| 5256 | if (options->set_default) |
| 5257 | options->set_default(options); |
| 5258 | |
| 5259 | if (HAS_MULTI_BITS(options->output_format & check_mask)) |
| 5260 | die(_("options '%s', '%s', '%s', and '%s' cannot be used together"), |
| 5261 | "--name-only", "--name-status", "--check", "-s"); |
| 5262 | |
| 5263 | if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_MASK)) |
| 5264 | die(_("options '%s', '%s', and '%s' cannot be used together"), |
| 5265 | "-G", "-S", "--find-object"); |
| 5266 | |
| 5267 | if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_G_REGEX_MASK)) |
| 5268 | die(_("options '%s' and '%s' cannot be used together, use '%s' with '%s'"), |
| 5269 | "-G", "--pickaxe-regex", "--pickaxe-regex", "-S"); |
| 5270 | |
| 5271 | if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_ALL_OBJFIND_MASK)) |
| 5272 | die(_("options '%s' and '%s' cannot be used together, use '%s' with '%s' and '%s'"), |
| 5273 | "--pickaxe-all", "--find-object", "--pickaxe-all", "-G", "-S"); |
| 5274 | |
| 5275 | /* |
| 5276 | * Most of the time we can say "there are changes" |
| 5277 | * only by checking if there are changed paths, but |
| 5278 | * --ignore-whitespace* options force us to look |
| 5279 | * inside contents. |
| 5280 | */ |
| 5281 | |
| 5282 | if ((options->xdl_opts & XDF_WHITESPACE_FLAGS) || |
| 5283 | options->ignore_regex_nr) |
| 5284 | options->flags.diff_from_contents = 1; |
| 5285 | else |
| 5286 | options->flags.diff_from_contents = 0; |
| 5287 | |
| 5288 | if (options->flags.find_copies_harder) |
| 5289 | options->detect_rename = DIFF_DETECT_COPY; |
| 5290 | |
| 5291 | if (!options->flags.relative_name) |
| 5292 | options->prefix = NULL; |
| 5293 | if (options->prefix) |
| 5294 | options->prefix_length = strlen(options->prefix); |
| 5295 | else |
| 5296 | options->prefix_length = 0; |
| 5297 | |
| 5298 | /* |
| 5299 | * --name-only, --name-status, --checkdiff, and -s |
| 5300 | * turn other output format off. |
| 5301 | */ |
no test coverage detected