From: Jakob Pfender <jpfender@elegosoft.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [RFD] git update-index --remove frotz --add frotz expected behaviour?
Date: Thu, 24 Mar 2011 18:07:57 +0100 [thread overview]
Message-ID: <4D8B7A6D.5050801@elegosoft.com> (raw)
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?
next reply other threads:[~2011-03-24 17:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-24 17:07 Jakob Pfender [this message]
2011-03-24 18:28 ` [RFD] git update-index --remove frotz --add frotz expected behaviour? Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D8B7A6D.5050801@elegosoft.com \
--to=jpfender@elegosoft.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.