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 355d02a commit aa87980Copy full SHA for aa87980
crates/gitbutler-stack/src/stack.rs
@@ -358,7 +358,13 @@ impl Stack {
358
) -> Result<StackBranch> {
359
let state = branch_state(ctx);
360
let repo = ctx.gix_repository()?;
361
- let commit = ctx.repo().find_commit(self.head(&repo)?)?;
+ // If the stack is created for the first time, this will be the default target sha
362
+ let head = if self.heads.is_empty() {
363
+ self.head
364
+ } else {
365
+ self.head(&repo)?
366
+ };
367
+ let commit = ctx.repo().find_commit(head)?;
368
369
let name = Stack::next_available_name(
370
&repo,
0 commit comments