Skip to main content

resolve_target

Function resolve_target 

Source
pub fn resolve_target(
    dir: &Path,
    positionals: &[String],
    staged: bool,
    base: Option<&str>,
    lookup: &dyn PrLookup,
) -> Result<Target>
Expand description

Works out what the command-line arguments ask to review:

  • nothing: on a branch other than the main one, everything that branch changes — its commits since it split off from the main branch (or base), plus uncommitted and untracked work; on the main branch, just the uncommitted work;
  • a GitHub or Azure DevOps PR URL, or pr <url | number>: that pull request;
  • a branch: that branch against the default branch (base overrides it), from the point where it branched off — a branch only on origin is fetched first;
  • a..b / a...b: as in git diff;
  • any other revision: that revision against the working tree.