scm: use cached value, but do check for "" return too.

The previous commit made things SLOW due to fork/exec/parse too
much! Return if we have a result that is not "". Don't
repopulate if value is good!
This commit is contained in:
Al Poole 2018-03-21 22:16:54 +00:00
parent 371126c09d
commit f92c4c13d6
1 changed files with 3 additions and 3 deletions

View File

@ -435,7 +435,7 @@ _edi_scm_git_remote_name_get(void)
return NULL;
if (_remote_name)
free(_remote_name);
return _remote_name;
_remote_name = _edi_scm_exec_response("git config --get user.name");
@ -458,7 +458,7 @@ _edi_scm_git_remote_email_get(void)
return NULL;
if (_remote_email)
free(_remote_email);
return _remote_email;
_remote_email = _edi_scm_exec_response("git config --get user.email");
@ -481,7 +481,7 @@ _edi_scm_git_remote_url_get(void)
return NULL;
if (_remote_url)
free(_remote_url);
return _remote_url;
_remote_url = _edi_scm_exec_response("git remote get-url origin");