]> git.ipfire.org Git - thirdparty/git.git/commit
write_entry(): fix misuses of `path` in error messages
authorMatheus Tavares <matheus.bernardino@usp.br>
Tue, 16 Feb 2021 14:06:51 +0000 (11:06 -0300)
committerJunio C Hamano <gitster@pobox.com>
Tue, 16 Feb 2021 19:27:17 +0000 (11:27 -0800)
commit9334ea8e92d4011f07a35a98adf6207e175f852c
tree55a5663d8388fd35d228f42db3ea5d37458c0ad1
parent773e25afc41b1b6533fa9ae2cd825d0b4a697fad
write_entry(): fix misuses of `path` in error messages

The variables `path` and `ce->name`, at write_entry(), usually have the
same contents, but that's not the case when using a checkout prefix or
writing to a tempfile. (In fact, `path` will be either empty or dirty
when writing to a tempfile.) Therefore, these variables cannot be used
interchangeably. In this sense, fix wrong uses of `path` in error
messages where it should really be `ce->name`, and add some regression
tests. (Note: there doesn't seem to be any misuse in the other way
around.)

Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
entry.c
t/t2006-checkout-index-basic.sh