Make commit amend work when a resource is selected