summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-06-24 14:28:39 -0700
committerJunio C Hamano <gitster@pobox.com>2017-06-24 14:28:40 -0700
commit1c3d87cf5594cc7e57d71c7b2d99dd4982285951 (patch)
tree9a461af87a2e6c7191cd158093b37f0eea6f0c2a /config.c
parent9bca0e5513579386384c064c5cdc45980b6774df (diff)
parenta9bcf6586d1a4888aea91553d73cda20494b8335 (diff)
downloadgit-1c3d87cf5594cc7e57d71c7b2d99dd4982285951.tar.gz
Merge branch 'js/alias-early-config'
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 34a139c40b..547daf87d4 100644
--- a/config.c
+++ b/config.c
@@ -604,7 +604,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;
}