summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorHeiko Voigt <hvoigt@hvoigt.net>2016-07-28 12:49:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-07-28 20:05:14 (GMT)
commit514dea905a3c72c8f7268347793f2947efd547be (patch)
tree8d4e54782d8bdfa4eece467e5b7a4112b0a9a560 /t
parent508a285ceab4523412546a92cd9444f8e78065e1 (diff)
downloadgit-514dea905a3c72c8f7268347793f2947efd547be.zip
git-514dea905a3c72c8f7268347793f2947efd547be.tar.gz
git-514dea905a3c72c8f7268347793f2947efd547be.tar.bz2
submodule-config: passing name reference for .gitmodule blobs
Commit 959b5455 (submodule: implement a config API for lookup of .gitmodules values, 2015-08-18) implemented the initial version of the submodule config cache. During development of that initial version we extracted the function gitmodule_sha1_from_commit(). During that process we missed that the strbuf rev was still used in config_from() and now is left empty. Lets fix this by also returning this string. This means that now when reading .gitmodules from revisions, the error messages also contain a reference to the blob they are from. Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7411-submodule-config.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t7411-submodule-config.sh b/t/t7411-submodule-config.sh
index fc97c33..400e2b1 100755
--- a/t/t7411-submodule-config.sh
+++ b/t/t7411-submodule-config.sh
@@ -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'