diff options
author | Hiltjo Posthuma <[email protected]> | 2022-01-03 12:21:12 +0100 |
---|---|---|
committer | Hiltjo Posthuma <[email protected]> | 2022-01-03 12:22:52 +0100 |
commit | 4d19863b062ac469fe09dec014976ba3b8677fb0 (patch) | |
tree | d847682155a0c875ef38f070294258d253b637c4 /stagit.c | |
parent | df2a31c67a7b6ca782121248f650526a4fbe08d2 (diff) | |
download | stagit-4d19863b062ac469fe09dec014976ba3b8677fb0.tar.gz stagit-4d19863b062ac469fe09dec014976ba3b8677fb0.zip |
libgit2 config opts: set the search to an empty path
Otherwise this would search outside the unveiled paths and cause an unveil
violation.
Reported by Anton Lindqvist, thanks!
Diffstat (limited to 'stagit.c')
-rw-r--r-- | stagit.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1220,7 +1220,11 @@ main(int argc, char *argv[]) if (!realpath(repodir, repodirabs)) err(1, "realpath"); + /* do not search outside the git repository: + GIT_CONFIG_LEVEL_APP is the highest level currently */ git_libgit2_init(); + for (i = 1; i <= GIT_CONFIG_LEVEL_APP; i++) + git_libgit2_opts(GIT_OPT_SET_SEARCH_PATH, i, ""); #ifdef __OpenBSD__ if (unveil(repodir, "r") == -1) |