summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorDevin Lehmacher <lehmacdj@gmail.com>2017-03-13 20:43:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-03-13 21:39:36 (GMT)
commite7f136bf93132c24183c168a9a054540e6216c06 (patch)
treeb5ee63d508156d6a420bdc2a5acaf253f4ea1694 /cache.h
parentd6db3f216544d05e09159756812ccbcb16861d71 (diff)
downloadgit-e7f136bf93132c24183c168a9a054540e6216c06.zip
git-e7f136bf93132c24183c168a9a054540e6216c06.tar.gz
git-e7f136bf93132c24183c168a9a054540e6216c06.tar.bz2
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>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 8c0e644..5db29a9 100644
--- a/cache.h
+++ b/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