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)
commit2e9de01aa0c44b539fca05b3ee552013d64c283a
tree2fd16844ba1d86135c291f3ac255b633b57b33e6
parent5e00a6c873981f87165adfecf29ad0ecc2c2c5df
t1404: add a bunch of tests of D/F conflicts

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>
t/t1404-update-ref-errors.sh