path.c: add xdg_cache_home
We already have xdg_config_home to format paths relative to XDG_CONFIG_HOME. Let's provide a similar function xdg_cache_home to do the same for paths relative to XDG_CACHE_HOME. Signed-off-by: Devin Lehmacher <lehmacdj@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
d6db3f2165
commit
e7f136bf93
7
cache.h
7
cache.h
@ -1169,6 +1169,13 @@ extern int is_ntfs_dotgit(const char *name);
|
||||
*/
|
||||
extern char *xdg_config_home(const char *filename);
|
||||
|
||||
/**
|
||||
* Return a newly allocated string with the evaluation of
|
||||
* "$XDG_CACHE_HOME/git/$filename" if $XDG_CACHE_HOME is non-empty, otherwise
|
||||
* "$HOME/.cache/git/$filename". Return NULL upon error.
|
||||
*/
|
||||
extern char *xdg_cache_home(const char *filename);
|
||||
|
||||
/* object replacement */
|
||||
#define LOOKUP_REPLACE_OBJECT 1
|
||||
#define LOOKUP_UNKNOWN_OBJECT 2
|
||||
|
Reference in New Issue
Block a user