git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFD] git update-index --remove frotz --add frotz expected behaviour?
@ 2011-03-24 17:07 Jakob Pfender
  2011-03-24 18:28 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Jakob Pfender @ 2011-03-24 17:07 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

I'm a bit stumped by update-index' behaviour when calling --remove and 
--add on the same file in that order:

$ touch frotz
$ git update-index --add frotz
$ rm frotz
$ git status -s
AD frotz
$ git update-index --remove frotz --add frotz
$ echo $?
0
$ git status -s
$

Notice that update-index doesn't complain that I'm trying to add a file 
that doesn't exist, and it's returning with 0.

Is this expected behaviour? Shouldn't I get some sort of error message 
telling me that I'm trying to add a file I've just removed? Compare:

$ touch xyzzy
$ git update-index --add xyzzy
$ rm xyzzy
$ git update-index --remove xyzzy
$ git update-index --add xyzzy
error: xyzzy: does not exist and --remove not passed
fatal: Unable to process path xyzzy

Can anyone explain this to me?

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

end of thread, other threads:[~2011-03-24 18:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-24 17:07 [RFD] git update-index --remove frotz --add frotz expected behaviour? Jakob Pfender
2011-03-24 18:28 ` Junio C Hamano

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).