path: root/t/
diff options
authorAtharva Raykar <>2021-07-10 07:47:59 (GMT)
committerJunio C Hamano <>2021-07-12 19:06:21 (GMT)
commit0008d12284ef916b53341c2aadccdc017ff07c7a (patch)
treeb35d7bcc6e319b07d27b10e04c9307cc5deea489 /t/
parent84069fcc140480fb76dc204ebce7819c2c87ec7c (diff)
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 ''. 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 <> Mentored-by: Christian Couder <> Mentored-by: Shourya Shukla <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't/')
1 files changed, 2 insertions, 2 deletions
diff --git a/t/ b/t/
index 7aa7fef..cb1b8e3 100755
--- a/t/
+++ b/t/
@@ -51,7 +51,7 @@ test_expect_success 'submodule update aborts on missing gitmodules url' '
test_expect_success 'add aborts on repository with no commits' '
cat >expect <<-\EOF &&
- '"'repo-no-commits'"' does not have a commit checked out
+ fatal: '"'repo-no-commits'"' does not have a commit checked out
git init repo-no-commits &&
test_must_fail git submodule add ../a ./repo-no-commits 2>actual &&
@@ -199,7 +199,7 @@ test_expect_success 'submodule add to .gitignored path with --force' '
test_expect_success 'submodule add to path with tracked content fails' '
cd addtest &&
- echo "'\''dir-tracked'\'' already exists in the index" >expect &&
+ echo "fatal: '\''dir-tracked'\'' already exists in the index" >expect &&
mkdir dir-tracked &&
test_commit foo dir-tracked/bar &&
test_must_fail git submodule add "$submodurl" dir-tracked >actual 2>&1 &&