Re: [PATCH] environment.c: introduce DECLARE_GIT_GETTER helper macro

2016-03-01 Thread Junio C Hamano
Jeff King writes: > On Sun, Feb 28, 2016 at 01:35:44AM +0600, Alexander Kuleshov wrote: > >> +DECLARE_GIT_GETTER(const char *, get_git_dir, git_dir) >> +DECLARE_GIT_GETTER(const char *, get_git_namespace, namespace) >> +DECLARE_GIT_GETTER(char *, get_object_directory,

Re: [PATCH] environment.c: introduce DECLARE_GIT_GETTER helper macro

2016-03-01 Thread Jeff King
On Sun, Feb 28, 2016 at 01:35:44AM +0600, Alexander Kuleshov wrote: > +DECLARE_GIT_GETTER(const char *, get_git_dir, git_dir) > +DECLARE_GIT_GETTER(const char *, get_git_namespace, namespace) > +DECLARE_GIT_GETTER(char *, get_object_directory, git_object_dir) > +DECLARE_GIT_GETTER(char *,

[PATCH] environment.c: introduce DECLARE_GIT_GETTER helper macro

2016-02-27 Thread Alexander Kuleshov
The environment.c contans a couple of functions which are consist from the following pattern: if (!env) setup_git_env(); return env; Let's move declaration of these functions to the DECLARE_GIT_GETTER helper macro to prevent code duplication. Signed-off-by: