mirror of
https://github.com/openai/codex.git
synced 2026-06-01 19:02:59 +00:00
feat(worktree): add move-all dirty policy
This commit is contained in:
@@ -789,6 +789,7 @@ fn dirty_policy_from_cli(arg: WorktreeDirtyCliArg) -> DirtyPolicy {
|
||||
WorktreeDirtyCliArg::Ignore => DirtyPolicy::Ignore,
|
||||
WorktreeDirtyCliArg::CopyTracked => DirtyPolicy::CopyTracked,
|
||||
WorktreeDirtyCliArg::CopyAll => DirtyPolicy::CopyAll,
|
||||
WorktreeDirtyCliArg::MoveAll => DirtyPolicy::MoveAll,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2418,6 +2419,20 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn top_level_worktree_flags_parse_move_all_dirty_policy() {
|
||||
let cli = MultitoolCli::try_parse_from([
|
||||
"codex",
|
||||
"--worktree",
|
||||
"parser-fix",
|
||||
"--worktree-dirty",
|
||||
"move-all",
|
||||
])
|
||||
.expect("worktree flags should parse");
|
||||
|
||||
assert_eq!(cli.interactive.worktree_dirty, WorktreeDirtyCliArg::MoveAll);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn worktree_subcommand_parses() {
|
||||
let cli = MultitoolCli::try_parse_from(["codex", "worktree", "list", "--all", "--json"])
|
||||
|
||||
Reference in New Issue
Block a user