summaryrefslogtreecommitdiff
path: root/t/helper
diff options
context:
space:
mode:
authorBert Wesarg <bert.wesarg@googlemail.com>2020-01-27 07:04:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-02-10 18:52:10 (GMT)
commitf2a2327a4a6a9bccade6df2bed1fdc3a8ab37f4c (patch)
tree4fe82fc9fa6fd1366d7ffa392be73e633a252a45 /t/helper
parent923d4a5ca4f86c19247ef436e6d03d261ebce904 (diff)
downloadgit-f2a2327a4a6a9bccade6df2bed1fdc3a8ab37f4c.zip
git-f2a2327a4a6a9bccade6df2bed1fdc3a8ab37f4c.tar.gz
git-f2a2327a4a6a9bccade6df2bed1fdc3a8ab37f4c.tar.bz2
config: provide access to the current line number
Users are nowadays trained to see message from CLI tools in the form <file>:<lno>: … To be able to give such messages when notifying the user about configurations in any config file, it is currently only possible to get the file name (if the value originates from a file to begin with) via `current_config_name()`. Now it is also possible to query the current line number for the configuration. Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper')
-rw-r--r--t/helper/test-config.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/t/helper/test-config.c b/t/helper/test-config.c
index 1e3bc7c..234c722 100644
--- a/t/helper/test-config.c
+++ b/t/helper/test-config.c
@@ -48,6 +48,7 @@ static int iterate_cb(const char *var, const char *value, void *data)
printf("value=%s\n", value ? value : "(null)");
printf("origin=%s\n", current_config_origin_type());
printf("name=%s\n", current_config_name());
+ printf("lno=%d\n", current_config_line());
printf("scope=%s\n", config_scope_name(current_config_scope()));
return 0;