summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-02-25 19:18:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-02-25 19:18:32 (GMT)
commitd0038f4b31d6ab1f0602a4d3c19e35c5004175fa (patch)
tree2b67cde99b211b34335e838515690896794c6d75 /config.c
parent51ebf55b9309824346a6589c9f3b130c6f371b8f (diff)
parentb3fd6cbf29435f8b49a0a5d9f86236e00b084624 (diff)
downloadgit-d0038f4b31d6ab1f0602a4d3c19e35c5004175fa.zip
git-d0038f4b31d6ab1f0602a4d3c19e35c5004175fa.tar.gz
git-d0038f4b31d6ab1f0602a4d3c19e35c5004175fa.tar.bz2
Merge branch 'bw/remote-rename-update-config'
"git remote rename X Y" needs to adjust configuration variables (e.g. branch.<name>.remote) whose value used to be X to Y. branch.<name>.pushRemote is now also updated. * bw/remote-rename-update-config: remote rename/remove: gently handle remote.pushDefault config config: provide access to the current line number remote rename/remove: handle branch.<name>.pushRemote config values remote: clean-up config callback remote: clean-up by returning early to avoid one indentation pull --rebase/remote rename: document and honor single-letter abbreviations rebase types
Diffstat (limited to 'config.c')
-rw-r--r--config.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/config.c b/config.c
index 79b0a56..d17d2bd 100644
--- a/config.c
+++ b/config.c
@@ -3338,6 +3338,14 @@ enum config_scope current_config_scope(void)
return current_parsing_scope;
}
+int current_config_line(void)
+{
+ if (current_config_kvi)
+ return current_config_kvi->linenr;
+ else
+ return cf->linenr;
+}
+
int lookup_config(const char **mapping, int nr_mapping, const char *var)
{
int i;