Thread (11 messages) flat view 11 messages, 3 authors, 2016-06-15

Re: Adding empty directory gives bogus error message

From: Jeff King <hidden>
Date: 2016-06-15 22:43:15

On Sun, Jun 10, 2007 at 10:46:48PM +0200, Jonas Fonseca wrote:
During a talk with madduck on #git today, we stumbled upon this
confusing error message:

  $ mkdir repo
  $ cd repo/
  $ git init
  Initialized empty Git repository in .git/
  $ mkdir empty
  $ git add empty/
  The following paths are ignored by one of your .gitignore files:
  empty/ (directory)
  Use -f if you really want to add them.
  $ git add -f empty/
  fatal: unable to index file empty/
Urgh, that's ugly. The problem is that git-add sticks
assumed-to-be-ignored stuff back into the list of files found by
read_directory, but with some special ignored flags (which aren't used
anywhere else!). When the assumption is wrong (because the path is
_actually_ just empty), you get the bogus message, and when you try to
force it, you get an error from elsewhere in the code.

Patch series will be out momentarily.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help