1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-28 12:59:41 +01:00

Merge branch 'cc/split-index-config'

The split-index code configuration code used an unsafe git_path()
function without copying its result out.

* cc/split-index-config:
  read-cache: avoid using git_path() in freshen_shared_index()
This commit is contained in:
Junio C Hamano 2017-04-26 15:39:09 +09:00
commit 3961c51699

View file

@ -1824,9 +1824,10 @@ int do_read_index(struct index_state *istate, const char *path, int must_exist)
*/
static void freshen_shared_index(char *base_sha1_hex, int warn)
{
const char *shared_index = git_path("sharedindex.%s", base_sha1_hex);
char *shared_index = git_pathdup("sharedindex.%s", base_sha1_hex);
if (!check_and_freshen_file(shared_index, 1) && warn)
warning("could not freshen shared index '%s'", shared_index);
free(shared_index);
}
int read_index_from(struct index_state *istate, const char *path)