Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-07-10 23:58:57 +0300
committerJunio C Hamano <gitster@pobox.com>2017-07-10 23:58:58 +0300
commit040746c061c1138222d7db1f9ace292ef1a0935d (patch)
tree1cd0b022889ba7e8bb3672e6950f90002cd451d0 /config.c
parent49771171e5b2802413a8645e8d1a25fafa5eca9f (diff)
parenta9bcf6586d1a4888aea91553d73cda20494b8335 (diff)
Merge branch 'js/alias-early-config' into maint
The code to pick up and execute command alias definition from the configuration used to switch to the top of the working tree and then come back when the expanded alias was executed, which was unnecessarilyl complex. Attempt to simplify the logic by using the early-config mechanism that does not chdir around. * js/alias-early-config: alias: use the early config machinery to expand aliases t7006: demonstrate a problem with aliases in subdirectories t1308: relax the test verifying that empty alias values are disallowed help: use early config when autocorrecting aliases config: report correct line number upon error discover_git_directory(): avoid setting invalid git_dir
Diffstat (limited to 'config.c')
-rw-r--r--config.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/config.c b/config.c
index a30056ec7e..f0511e58e2 100644
--- a/config.c
+++ b/config.c
@@ -588,7 +588,8 @@ static int get_value(config_fn_t fn, void *data, struct strbuf *name)
*/
cf->linenr--;
ret = fn(name->buf, value, data);
- cf->linenr++;
+ if (ret >= 0)
+ cf->linenr++;
return ret;
}