]> git.ipfire.org Git - thirdparty/git.git/commit - git-submodule.sh
submodule: prefix die messages with 'fatal'
authorAtharva Raykar <raykar.ath@gmail.com>
Sat, 10 Jul 2021 07:47:59 +0000 (13:17 +0530)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Jul 2021 19:06:21 +0000 (12:06 -0700)
commit0008d12284ef916b53341c2aadccdc017ff07c7a
treeb35d7bcc6e319b07d27b10e04c9307cc5deea489
parent84069fcc140480fb76dc204ebce7819c2c87ec7c
submodule: prefix die messages with 'fatal'

The standard `die()` function that is used in C code prefixes all the
messages passed to it with 'fatal: '. This does not happen with the
`die` used in 'git-submodule.sh'.

Let's prefix each of the shell die messages with 'fatal: ' so that when
they are converted to C code, the error messages stay the same as before
the conversion.

Note that the shell version of `die` exits with error code 1, while the
C version exits with error code 128. In practice, this does not change
any behaviour, as no functionality in 'submodule add' and 'submodule
update' relies on the value of the exit code.

Signed-off-by: Atharva Raykar <raykar.ath@gmail.com>
Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Shourya Shukla <periperidip@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-submodule.sh
t/t7400-submodule-basic.sh
t/t7406-submodule-update.sh