mirror of
https://github.com/openai/codex.git
synced 2026-11-26 23:40:43 +00:00
feat(worktree): fill remaining worktree gaps
This commit is contained in:
@@ -236,9 +236,10 @@ fn parse_dirty_policy(value: &str) -> Result<DirtyPolicy, String> {
|
||||
"ignore" => Ok(DirtyPolicy::Ignore),
|
||||
"copy-tracked" => Ok(DirtyPolicy::CopyTracked),
|
||||
"copy-all" => Ok(DirtyPolicy::CopyAll),
|
||||
"move-tracked" => Ok(DirtyPolicy::MoveTracked),
|
||||
"move-all" => Ok(DirtyPolicy::MoveAll),
|
||||
_ => Err(
|
||||
"Dirty mode must be one of: fail, ignore, copy-tracked, copy-all, move-all."
|
||||
"Dirty mode must be one of: fail, ignore, copy-tracked, copy-all, move-tracked, move-all."
|
||||
.to_string(),
|
||||
),
|
||||
}
|
||||
@@ -492,6 +493,11 @@ pub(crate) fn dirty_policy_prompt_params(
|
||||
"Copy tracked changes and untracked files.",
|
||||
DirtyPolicy::CopyAll,
|
||||
),
|
||||
item(
|
||||
"Move tracked",
|
||||
"Move staged and unstaged tracked changes; leave untracked files behind.",
|
||||
DirtyPolicy::MoveTracked,
|
||||
),
|
||||
item(
|
||||
"Copy tracked",
|
||||
"Copy staged and unstaged tracked changes.",
|
||||
@@ -643,6 +649,18 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_new_with_move_tracked_dirty_policy() {
|
||||
assert_eq!(
|
||||
parse_worktree_slash_args("new fcoury/demo --dirty move-tracked"),
|
||||
Ok(WorktreeSlashAction::Create {
|
||||
branch: "fcoury/demo".to_string(),
|
||||
base_ref: /*base_ref*/ None,
|
||||
dirty_policy: Some(DirtyPolicy::MoveTracked),
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_switch_aliases_move() {
|
||||
assert_eq!(
|
||||
|
||||
Reference in New Issue
Block a user