summaryrefslogtreecommitdiff
path: root/t/t1307-config-blob.sh
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2018-05-18 15:27:04 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-05-21 09:47:13 +0900
commit17b8a2d6cdfc359b1a7de6dd215dc3c32ab1dbfe (patch)
tree9555b1a5ed7a22b96f06093a536c52c4573c7921 /t/t1307-config-blob.sh
parentGit 2.17 (diff)
downloadtgif-17b8a2d6cdfc359b1a7de6dd215dc3c32ab1dbfe.tar.xz
config: die when --blob is used outside a repository
If you run "config --blob" outside of a repository, then we eventually try to resolve the blob name and hit a BUG(). Let's catch this earlier and provide a useful message. Note that we could also catch this much lower in the stack, in git_config_from_blob_ref(). That might cover other callsites, too, but it's unclear whether those ones would actually be bugs or not. So let's leave the low-level functions to assume the caller knows what it's doing (and BUG() if it turns out it doesn't). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1307-config-blob.sh')
-rwxr-xr-xt/t1307-config-blob.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/t/t1307-config-blob.sh b/t/t1307-config-blob.sh
index eed31ffa30..37dc689d8c 100755
--- a/t/t1307-config-blob.sh
+++ b/t/t1307-config-blob.sh
@@ -73,4 +73,8 @@ test_expect_success 'can parse blob ending with CR' '
test_cmp expect actual
'
+test_expect_success 'config --blob outside of a repository is an error' '
+ test_must_fail nongit git config --blob=foo --list
+'
+
test_done