Skip to content

Commit 56945f3

Browse files
committed
Handle no author on stack initialization
1 parent 8267487 commit 56945f3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/gitbutler-stack/src/stack.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,10 @@ impl Stack {
368368
self.name.clone()
369369
} else if let Some(refname) = self.upstream.as_ref() {
370370
refname.branch().to_string()
371+
} else if let Ok((author, _committer)) = ctx.repo().signatures() {
372+
generate_branch_name(author)?
371373
} else {
372-
let (author, _committer) = ctx.repo().signatures()?;
374+
let author = git2::Signature::now("Firstname Lastname", "[email protected]")?;
373375
generate_branch_name(author)?
374376
};
375377

0 commit comments

Comments
 (0)