git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git ls-files --error-unmatch weirdness
@ 2011-08-12 13:24 SZEDER Gábor
  2011-08-12 14:17 ` Nguyen Thai Ngoc Duy
  2011-08-12 17:56 ` Junio C Hamano
  0 siblings, 2 replies; 3+ messages in thread
From: SZEDER Gábor @ 2011-08-12 13:24 UTC (permalink / raw)
  To: git

Hi,

I was looking for untracked files when noticed this:

repo$ git init
Initialized empty Git repository in /home/szeder/tmp/git/repo/.git/
repo (master)$ mkdir dir
repo (master)$ touch dir/file
repo (master)$ git add dir/file
repo (master)$ git commit -m 'first'
[master (root-commit) 2c0990c] first
 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 dir/file
repo (master)$ git ls-files --others --error-unmatch
repo/dir (master)$ echo $?
0
repo (master)$ cd dir
repo/dir (master)$ git ls-files --others --error-unmatch
error: pathspec '' did not match any file(s) known to git.
Did you forget to 'git add'?
repo/dir (master)$ echo $?
1

So, the same 'git ls-files' command is OK when run at the top of the
worktree, but errors out in a subdirectory.  What's going on?  Is this
a bug?  If not, why not?


Thanks,
Gábor

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

end of thread, other threads:[~2011-08-12 17:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-12 13:24 git ls-files --error-unmatch weirdness SZEDER Gábor
2011-08-12 14:17 ` Nguyen Thai Ngoc Duy
2011-08-12 17:56 ` 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).