Commit cb7db5b
cache.h: Introduce a generic "xdg_config_home_for(…)" function
Current implementation of `xdg_config_home(filename)` returns
`$XDG_CONFIG_HOME/git/$filename`, with the `git` subdirectory inserted
between the `XDG_CONFIG_HOME` environment variable and the parameter.
This patch introduces a `xdg_config_home_for(subdir, filename)` function
which is more generic. It only concatenates "$XDG_CONFIG_HOME", or
"$HOME/.config" if the former isn’t defined, with the parameters,
without adding `git` in between.
`xdg_config_home(filename)` is now implemented by calling
`xdg_config_home_for("git", filename)` but this new generic function can
be used to compute the configuration directory of other programs.
Signed-off-by: Lénaïc Huard <lenaic@lhuard.fr>
Acked-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent ebf3c04 commit cb7db5b
2 files changed
+17
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1286 | 1286 | | |
1287 | 1287 | | |
1288 | 1288 | | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
1289 | 1296 | | |
1290 | 1297 | | |
1291 | 1298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1503 | 1503 | | |
1504 | 1504 | | |
1505 | 1505 | | |
1506 | | - | |
| 1506 | + | |
1507 | 1507 | | |
1508 | 1508 | | |
1509 | 1509 | | |
| 1510 | + | |
1510 | 1511 | | |
1511 | 1512 | | |
1512 | 1513 | | |
1513 | | - | |
| 1514 | + | |
1514 | 1515 | | |
1515 | 1516 | | |
1516 | 1517 | | |
1517 | | - | |
| 1518 | + | |
| 1519 | + | |
1518 | 1520 | | |
1519 | 1521 | | |
1520 | 1522 | | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
1521 | 1528 | | |
1522 | 1529 | | |
1523 | 1530 | | |
| |||
0 commit comments