t1404: add a bunch of tests of D/F conflicts
authorMichael Haggerty <mhagger@alum.mit.edu>
Tue, 24 Oct 2017 15:16:24 +0000 (17:16 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 25 Oct 2017 06:08:26 +0000 (15:08 +0900)
It is currently not allowed, in a single transaction, to add one
reference and delete another reference if the two reference names D/F
conflict with each other (e.g., like `refs/foo/bar` and `refs/foo`).
The reason is that the code would need to take locks

$GIT_DIR/refs/foo.lock
$GIT_DIR/refs/foo/bar.lock

But the latter lock couldn't coexist with the loose reference file

$GIT_DIR/refs/foo

, because `$GIT_DIR/refs/foo` cannot be both a directory and a file at
the same time (hence the name "D/F conflict).

Add a bunch of tests that we cleanly reject such transactions.

In fact, many of the new tests currently fail. They will be fixed in
the next commit along with an explanation.

Reported-by: Jeff King <peff@peff.net>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found