1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! Core library for `git-workon`, an opinionated git worktree workflow tool.
//!
//! This crate (published as `workon`) provides the building blocks for cloning,
//! initialising, and managing git repositories in a bare-repo-plus-worktrees layout.
//!
//! ## Key types
//!
//! - [`WorktreeDescriptor`] — wraps a git2 `Worktree` with rich metadata methods
//! - [`BranchType`] — controls how a branch is created for a new worktree
//! - [`WorkonConfig`] — reads `workon.*` settings from git config
//! - [`PullRequest`] / [`PrMetadata`] — PR reference parsing and gh CLI integration
//! - [`MoveOptions`] — options for [`move_worktree`]
//! - [`WorkonError`] and its sub-types — all error variants with miette diagnostics
//!
//! ## Key functions
//!
//! | Function | Description |
//! |---|---|
//! | [`clone`] | Clone a remote repository into the worktrees layout |
//! | [`init`] | Initialise a new bare repository with an initial commit |
//! | [`get_repo`] | Discover and open a bare repository from a path |
//! | [`get_worktrees`] | List all worktrees in a repository |
//! | [`add_worktree`] | Create a new worktree (normal, orphan, or detached) |
//! | [`find_worktree`] | Locate a worktree by name or branch |
//! | [`current_worktree`] | Return the worktree containing the current directory |
//! | [`move_worktree`] | Atomically rename a worktree and its branch |
//! | [`copy_untracked`] | Copy untracked files between worktrees using git status |
//! | [`workon_root`] | Resolve the directory that holds all worktrees |
//!
//! ## Example
//!
//! ```no_run
//! use workon::{get_repo, get_worktrees, add_worktree, BranchType};
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let repo = get_repo(None)?;
//!
//! for wt in get_worktrees(&repo)? {
//! println!("{}: {}", wt.name().unwrap_or("?"), wt.path().display());
//! }
//!
//! let wt = add_worktree(&repo, "my-feature", BranchType::Normal, None, false)?;
//! println!("Created: {}", wt.path().display());
//! # Ok(())
//! # }
//! ```
pub use crate*;
pub use crate*;
pub use crate*;
pub use crate*;
pub use crate*;
pub use crate*;
pub use crate*;
pub use crate*;
pub use crate*;
pub use crate*;
pub use crate*;
pub use crater#move::*;
pub use crate*;
pub use crate*;