static GFile * git_get_mirror_dir (const char *url, BuilderContext *context) { g_autoptr(GFile) git_dir = NULL; g_autofree char *filename = NULL; g_autofree char *git_dir_path = NULL; git_dir = g_file_get_child (builder_context_get_state_dir (context), "git"); git_dir_path = g_file_get_path (git_dir); g_mkdir_with_parents (git_dir_path, 0755); filename = builder_uri_to_filename (url); return g_file_get_child (git_dir, filename); }
static GFile * git_get_mirror_dir (const char *url_or_path, BuilderContext *context) { g_autoptr(GFile) git_dir = NULL; g_autofree char *filename = NULL; g_autofree char *git_dir_path = NULL; git_dir = g_file_get_child (builder_context_get_state_dir (context), "git"); git_dir_path = g_file_get_path (git_dir); g_mkdir_with_parents (git_dir_path, 0755); /* Technically a path isn't a uri but if it's absolute it should still be unique. */ filename = builder_uri_to_filename (url_or_path); return g_file_get_child (git_dir, filename); }