git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug: "git restore --staged" on a newly created repository
@ 2020-05-26  6:18 Xirui Zhao
  2020-05-27  7:32 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: Xirui Zhao @ 2020-05-26  6:18 UTC (permalink / raw)
  To: git

Tested on git version 2.27.0-rc1 (latest build from master branch on github) and 2.26.2
`git restore --staged file` on a newly created repository outputs error "fatal: could not resolve HEAD", but `git reset file` correctly unstages the file.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug: "git restore --staged" on a newly created repository
  2020-05-26  6:18 Bug: "git restore --staged" on a newly created repository Xirui Zhao
@ 2020-05-27  7:32 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2020-05-27  7:32 UTC (permalink / raw)
  To: Xirui Zhao; +Cc: git

On Tue, May 26, 2020 at 02:18:34PM +0800, Xirui Zhao wrote:

> Tested on git version 2.27.0-rc1 (latest build from master branch on github) and 2.26.2
> `git restore --staged file` on a newly created repository outputs
> error "fatal: could not resolve HEAD", but `git reset file` correctly
> unstages the file.

Yeah, "restore" is based on git-checkout, which is a little pickier than
"git reset" here. I don't think this ever worked in any version of
git-restore. It would probably be OK for it to use the empty tree when
HEAD is unborn, at least when operating in git-restore mode.

-Peff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-27  7:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-26  6:18 Bug: "git restore --staged" on a newly created repository Xirui Zhao
2020-05-27  7:32 ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).