Fix --disable-updates for git sources

We lost the ability to not update if a git repo was already checked out.
This fixes that again.

Closes: #98
Approved by: alexlarsson
tingping/wmclass
Alexander Larsson 2018-01-11 09:08:22 +01:00 committed by Atomic Bot
parent c06ee375c3
commit cd0c9da8f3
1 changed files with 9 additions and 3 deletions

View File

@ -516,9 +516,15 @@ builder_git_mirror_repo (const char *repo_location,
cached_git_dir = g_object_ref (cache_mirror_dir);
/* If we're not updating, only pull from cache to avoid network i/o */
if (!update && cached_git_dir)
origin = g_file_get_uri (cached_git_dir);
else
if (!update)
{
if (cached_git_dir)
origin = g_file_get_uri (cached_git_dir);
else if (!created)
return TRUE;
}
if (origin == NULL)
origin = g_strdup ("origin");
refs = git_ls_remote (mirror_dir, origin, error);