Skip to main content

resolve_diff_arguments

Function resolve_diff_arguments 

Source
pub fn resolve_diff_arguments(
    repo: &Repository,
    cwd_prefix: Option<&str>,
    staged: bool,
    unstaged: bool,
    against: Option<&str>,
    positionals: &[String],
    explicit_paths: &[String],
) -> Result<DiffArguments, ResolveDiffArgumentsError>
Expand description

Parse grit diff flags and positionals into a DiffTarget and pathspecs.

Shorthand for resolve_diff_request without a pathspec file.

§Parameters

  • repo - repository the revisions and paths belong to.
  • cwd_prefix - path from the work tree root to the process cwd (from pathdiff); None at the root, when unknown, or in a bare repository.
  • staged, unstaged, against - see DiffRequest.
  • positionals - operands before --.
  • explicit_paths - paths after --.

§Errors

Returns ResolveDiffArgumentsError for flag conflicts, unresolvable revisions, or pathspecs that cannot be resolved.