From 90674fafa04471302cb5ba2a4259f1cd1f545d74 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Wed, 22 Feb 2017 15:09:40 +0100 Subject: [PATCH] builder: Don't mirror submodules if told not to --- builder/builder-git.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/builder/builder-git.c b/builder/builder-git.c index 6dedd985..30595e77 100644 --- a/builder/builder-git.c +++ b/builder/builder-git.c @@ -248,12 +248,15 @@ builder_git_mirror_repo (const char *repo_location, return FALSE; } - current_commit = git_get_current_commit (mirror_dir, ref, context, error); - if (current_commit == NULL) - return FALSE; + if (mirror_submodules) + { + current_commit = git_get_current_commit (mirror_dir, ref, context, error); + if (current_commit == NULL) + return FALSE; - if (!git_mirror_submodules (repo_location, update, mirror_dir, current_commit, context, error)) - return FALSE; + if (!git_mirror_submodules (repo_location, update, mirror_dir, current_commit, context, error)) + return FALSE; + } return TRUE; }