Skip to main content

handle_reset_start_commit

Function handle_reset_start_commit 

Source
pub fn handle_reset_start_commit<H: AppEffectHandler>(
    handler: &mut H,
    working_dir_override: Option<&PathBuf>,
) -> Result<String, String>
Expand description

Handle the --reset-start-commit command using effects.

This function resets the .agent/start_commit file to track the merge-base with the default branch (or HEAD if on main/master).

§Arguments

  • handler - The effect handler to execute operations through
  • working_dir_override - Optional directory override (for testing)

§Returns

Returns the OID that was written to the start_commit file, or an error.

§Effects Emitted

  1. SetCurrentDir - If working_dir_override is provided
  2. GitRequireRepo - Validates git repository exists
  3. GitGetRepoRoot - Gets the repository root path
  4. SetCurrentDir - Changes to repo root (if no override)
  5. GitResetStartCommit - Resets the start commit reference