diff options
author | Kristoffer Haugsbakk <code@khaugsbakk.name> | 2024-10-22 23:14:33 +0200 |
---|---|---|
committer | Taylor Blau <me@ttaylorr.com> | 2024-10-23 16:36:15 -0400 |
commit | 0fcd473fdd3f8d2c418a4fafcbee2a523bd610cb (patch) | |
tree | 1656a5a375f41726e27f83ceb89819bbf7760edc /commit.c | |
parent | 34b6ce9b30747131b6e781ff718a45328aa887d0 (diff) |
t7001: add failure test which triggers assertion
`git mv a/a.txt a b/` is a nonsense instruction. Instead of failing
gracefully the command trips over itself,[1] leaving behind unfinished
work:
1. first it moves `a/a.txt` to `b/a.txt`; then
2. tries to move `a/`, including `a/a.txt`; then
3. figures out that it’s in a bad state (assertion); and finally
4. aborts.
Now you’re left with a partially-updated index.
The command should instead fail gracefully and make no changes to the
index until it knows that it can complete a sensible action.
For now just add a failing test since this has been known about for
a while.[2]
† 1: Caused by a `pos >= 0` assertion
[2]: https://lore.kernel.org/git/d1f739fe-b28e-451f-9e01-3d2e24a0fe0d@app.fastmail.com/
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 'commit.c')
0 files changed, 0 insertions, 0 deletions