[PATCH v4] sha1_file: pass empty buffer to index empty file

2015-05-17 Thread Jim Hill
`git add` of an empty file with a filter pops complaints from `copy_fd` about a bad file descriptor. This traces back to these lines in sha1_file.c:index_core: if (!size) { ret = index_mem(sha1, NULL, size, type, path, flags); The problem here is that content to be added

Re: [PATCH v3] sha1_file: pass empty buffer to index empty file

2015-05-17 Thread Junio C Hamano
Jim Hill writes: > +test_expect_success "filter: smudge empty file" ' > + git config filter.empty-in-repo.clean true && But this one is correct but tricky ;-) If the contents to be cleaned is small enough (i.e. the one-liner file used in this test) to fit in the pipe buffer and we feed the