Merge branch 'rs/submodule-config-code-cleanup' into maint
Code cleanup. * rs/submodule-config-code-cleanup: submodule-config: fix test binary crashing when no arguments given submodule-config: combine early return code into one goto submodule-config: passing name reference for .gitmodule blobs submodule-config: use explicit empty string instead of strbuf in config_from()
This commit is contained in:
@ -23,7 +23,7 @@ int main(int argc, char **argv)
|
||||
|
||||
arg++;
|
||||
my_argc--;
|
||||
while (starts_with(arg[0], "--")) {
|
||||
while (arg[0] && starts_with(arg[0], "--")) {
|
||||
if (!strcmp(arg[0], "--url"))
|
||||
output_url = 1;
|
||||
if (!strcmp(arg[0], "--name"))
|
||||
|
@ -82,6 +82,17 @@ test_expect_success 'error in one submodule config lets continue' '
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'error message contains blob reference' '
|
||||
(cd super &&
|
||||
sha1=$(git rev-parse HEAD) &&
|
||||
test-submodule-config \
|
||||
HEAD b \
|
||||
HEAD submodule \
|
||||
2>actual_err &&
|
||||
grep "submodule-blob $sha1:.gitmodules" actual_err >/dev/null
|
||||
)
|
||||
'
|
||||
|
||||
cat >super/expect_url <<EOF
|
||||
Submodule url: 'git@somewhere.else.net:a.git' for path 'b'
|
||||
Submodule url: 'git@somewhere.else.net:submodule.git' for path 'submodule'
|
||||
|
Reference in New Issue
Block a user