| 1565 | } |
| 1566 | |
| 1567 | char *xdg_cache_home(const char *filename) |
| 1568 | { |
| 1569 | const char *home, *cache_home; |
| 1570 | |
| 1571 | assert(filename); |
| 1572 | cache_home = getenv("XDG_CACHE_HOME"); |
| 1573 | if (cache_home && *cache_home) |
| 1574 | return mkpathdup("%s/git/%s", cache_home, filename); |
| 1575 | |
| 1576 | home = getenv("HOME"); |
| 1577 | if (home) |
| 1578 | return mkpathdup("%s/.cache/git/%s", home, filename); |
| 1579 | return NULL; |
| 1580 | } |
| 1581 | |
| 1582 | REPO_GIT_PATH_FUNC(squash_msg, "SQUASH_MSG") |
| 1583 | REPO_GIT_PATH_FUNC(merge_msg, "MERGE_MSG") |
no test coverage detected