[BUG] Git add <device file> silently fails
- From
- Andreas Gruenbacher <agruen@suse.de>
- Date
- Apr 17, 2010, 14:24 UTC
- Message-ID
- <201004171624.17797.agruen@suse.de>
Hello,
there is code in read-cache.c:add_to_index() which checks if a file to be added is a regular file, directory, or symlink; this function otherwise error()s out. It looks as if add_to_index() is supposed to be called via:
builtin/add.c:update_callback() ->
read-cache.c:add_file_to_index() ->
read-cache.c:add_to_index()However, when trying to add a device special file, update_callback() ends up never getting called, no error message is produced, and git add silently fails:
$ sudo mknod foobar c 1 3 $ git add foobar $ echo $? 0
Maybe someone familiar with run_diff_files() can have a look?
Thanks, Andreas