t1409: check that `packed-refs` is not rewritten unnecessarily
authorMichael Haggerty <mhagger@alum.mit.edu>
Wed, 25 Oct 2017 09:53:20 +0000 (11:53 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 27 Oct 2017 01:12:42 +0000 (10:12 +0900)
commitcf79bd9f4c34c635a5a7eeff2699a24744c5a129
tree740855f6bae159ccd6a1744e6897d42d2a1da8fc
parent5e00a6c873981f87165adfecf29ad0ecc2c2c5df
t1409: check that `packed-refs` is not rewritten unnecessarily

There is no need to rewrite the `packed-refs` file except for the case
that we are deleting a reference that has a packed version. Verify
that `packed-refs` is not rewritten when it shouldn't be.

In fact, two of these tests fail:

* A new (empty) `packed-refs` file is created when deleting any loose
  reference and no `packed-refs` file previously existed.

* The `packed-refs` file is rewritten unnecessarily when deleting a
  loose reference that has no packed counterpart.

Both problems will be fixed in the next commit.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1409-avoid-packing-refs.sh [new file with mode: 0755]