We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b745cc commit 08219d4Copy full SHA for 08219d4
1 file changed
gitoxide-core/src/repository/worktree.rs
@@ -57,10 +57,10 @@ impl WorktreeInfo {
57
}
58
59
fn create_worktree_info(repo: &gix::Repository, base: std::path::PathBuf) -> anyhow::Result<WorktreeInfo> {
60
- let head = repo
61
- .head_id()
62
- .map(|id| id.to_hex_with_len(HEAD_LENGTH).to_string())
63
- .unwrap_or_else(|_| ZERO_HEAD.to_string());
+ let head = repo.head_id().map_or_else(
+ |_| ZERO_HEAD.to_string(),
+ |id| id.to_hex_with_len(HEAD_LENGTH).to_string(),
+ );
64
65
let branch = repo.head_name()?.map_or_else(
66
|| "<detached>".to_string(),
0 commit comments