Skip to content

Commit

Permalink
ref microsoft#44776 deleteRef instead of reset if commit has no parents
Browse files Browse the repository at this point in the history
  • Loading branch information
ryu1kn committed Apr 10, 2018
1 parent 81b3b44 commit 278842c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion extensions/git/src/commands.ts
Expand Up @@ -1123,7 +1123,12 @@ export class CommandCenter {
}

const commit = await repository.getCommit('HEAD');
await repository.reset('HEAD~');
if (commit.previousHashes.length > 0) {
await repository.reset('HEAD~');
} else {
await repository.deleteRef('HEAD');
await this.unstageAll(repository);
}
repository.inputBox.value = commit.message;
}

Expand Down

0 comments on commit 278842c

Please sign in to comment.