Skip to content

"Undo Last Commit" should be grayed out if there are no commits. #1798

Closed
@bjtucker

Description

@bjtucker

After initializing git repository, but before committing, I can select "Undo Last Commit" from the "..." menu. That fails, of course. The resulting git reset HEAD~ won't work if there are no commits.

Undo Last Commit should be grayed out if HEAD doesn't have a parent.

Here's the log:

git init
git fetch
fatal: No remote repository specified.  Please, specify either a URL or a
remote name from which new revisions should be fetched.
git reset HEAD~
fatal: ambiguous argument 'HEAD~': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
git fetch
fatal: No remote repository specified.  Please, specify either a URL or a
remote name from which new revisions should be fetched.
git fetch
fatal: No remote repository specified.  Please, specify either a URL or a
remote name from which new revisions should be fetched.
git fetch
fatal: No remote repository specified.  Please, specify either a URL or a
remote name from which new revisions should be fetched.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buggitGIT issues

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions