[RFD] git update-index --remove frotz --add frotz expected behaviour?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]