diff --git a/cli/src/lib.rs b/cli/src/lib.rs index cced6ab..cd41da3 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -250,8 +250,8 @@ pub enum Commands { /// Return the current table to the state it had in the commit with the given uuid `commit` Reset { - #[arg(help = "Hash of the commit to reset to", required = true)] - commit_hash: String, + #[arg(help = "UUID of the commit to reset to", required = true)] + commit_uuid: String, #[arg( short, diff --git a/src/bin/ghee.rs b/src/bin/ghee.rs index e3fb86c..db8862e 100644 --- a/src/bin/ghee.rs +++ b/src/bin/ghee.rs @@ -261,7 +261,7 @@ fn run_command(cmd: &Commands) { } Commands::Reset { - commit_hash, + commit_uuid, keep, verbose, } => { @@ -270,8 +270,8 @@ fn run_command(cmd: &Commands) { } else { NewFileHandling::Delete }; - reset(commit_hash, *verbose, new_file_handling) - .unwrap_or_else(|e| panic!("Error resetting to {}: {}", commit_hash, e)); + reset(commit_uuid, *verbose, new_file_handling) + .unwrap_or_else(|e| panic!("Error resetting to {}: {}", commit_uuid, e)); } } } diff --git a/src/cmd/reset.rs b/src/cmd/reset.rs index 1b01251..a7ce60c 100644 --- a/src/cmd/reset.rs +++ b/src/cmd/reset.rs @@ -14,22 +14,22 @@ pub enum ResetErr { } /** -* Return the current table to the state it had in the commit with the given uuid `commit` +* Return the current table to the state it had in the commit with the given uuid `commit_uuid` * * ## Errors * * If the current working directory is not contained by a table, an error will be returned. * An error also results if the commit hash does not match any commit. */ -pub fn reset(commit: &str, verbose: bool, new_file_handling: NewFileHandling) -> Result<()> { +pub fn reset(commit_uuid: &str, verbose: bool, new_file_handling: NewFileHandling) -> Result<()> { let cur = current_dir()?; let info = containing_table_info(&cur)?.ok_or(ResetErr::NotInTable)?; let table_path = info.path_abs(); - reset_path(table_path, commit, true, verbose, new_file_handling)?; + reset_path(table_path, commit_uuid, true, verbose, new_file_handling)?; - xattr::set(table_path, XATTR_HEAD.to_osstring(), commit.as_bytes())?; + xattr::set(table_path, XATTR_HEAD.to_osstring(), commit_uuid.as_bytes())?; Ok(()) }