Skip to content

Commit

Permalink
Fixes draft creation if branch can't be found
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Mar 20, 2024
1 parent b253fa2 commit b7087bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plus/drafts/draftsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,9 @@ export class DraftService implements Disposable {

const user = getSettledValue(userResult);

// We need to get the branch name from the baseSha if the change is a stash.
// We need to get the branch name if possible, otherwise default to HEAD
const branchNames = getSettledValue(branchNamesResult);
const branchName = branchNames?.[0] ?? '';
const branchName = branchNames?.[0] ?? 'HEAD';

let baseSha = change.revision.from;
if (!isSha(baseSha)) {
Expand Down

0 comments on commit b7087bf

Please sign in to comment.