git: Fix problems bundling git repos on older git versions

It seems we have to specify

git fetch --depth 1 origin $ref:$ref

instead of

git fetch --depth 1 origin $ref

because on older versions of git (1.8.3 at least) this otherwise just
sets FETCH_HEAD, rather than $ref in the fetching repo.
tingping/wmclass
Alexander Larsson 2017-09-26 19:36:09 +02:00
parent 7e0619a4de
commit 6294fafcc4
1 changed files with 3 additions and 1 deletions

View File

@ -374,6 +374,7 @@ builder_git_shallow_mirror_ref (const char *repo_location,
g_autofree char *file_name = NULL;
g_autofree char *destination_file_path = NULL;
g_autofree char *full_ref = NULL;
g_autofree char *full_ref_colon_full_ref = NULL;
cache_mirror_dir = git_get_mirror_dir (repo_location, context);
@ -410,8 +411,9 @@ builder_git_shallow_mirror_ref (const char *repo_location,
return FALSE;
}
full_ref_colon_full_ref = g_strdup_printf ("%s:%s", full_ref, full_ref);
if (!git (mirror_dir, NULL, error,
"fetch", "--depth", "1", "origin", full_ref, NULL))
"fetch", "--depth", "1", "origin", full_ref_colon_full_ref, NULL))
return FALSE;
if (mirror_submodules)