- git_object_dir = getenv(DB_ENVIRONMENT);
- if (!git_object_dir)
- git_object_dir = git_pathdup("objects");
- git_index_file = getenv(INDEX_ENVIRONMENT);
- if (!git_index_file)
- git_index_file = git_pathdup("index");
- git_graft_file = getenv(GRAFT_ENVIRONMENT);
- if (!git_graft_file)
- git_graft_file = git_pathdup("info/grafts");
+ git_object_dir = git_path_from_env(DB_ENVIRONMENT, "objects");
+ git_index_file = git_path_from_env(INDEX_ENVIRONMENT, "index");
+ git_graft_file = git_path_from_env(GRAFT_ENVIRONMENT, "info/grafts");