support/download: fetch all refs on full git clone
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Sat, 7 Nov 2015 04:39:24 +0000 (23:39 -0500)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 29 Nov 2015 17:52:44 +0000 (18:52 +0100)
When specifying BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION, a user may want to
specify the SHA of a reference different than a branch or tag.

For instance, Gerrit stores the patchsets under refs/changes/xx/xxx, and
Github stores the pull requests under refs/pull/xxx/head.

When cloning a repository with --bare, you don't fetch these references.
This patch uses --mirror for a full clone, in order to give the user
access to all references of the Git repository.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: "Maxime Hadjinlian" <maxime.hadjinlian@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
support/download/git

index 0e6103b648b3f2a965ebaedf23030a6cabddb3b7..357a55806e569e67999d1a1ddd8eee29dd9a6311 100755 (executable)
@@ -43,7 +43,7 @@ if [ -n "$(${GIT} ls-remote "${repo}" "${cset}" 2>&1)" ]; then
 fi
 if [ ${git_done} -eq 0 ]; then
     printf "Doing full clone\n"
-    ${GIT} clone ${verbose} --bare "${repo}" "${basename}"
+    ${GIT} clone ${verbose} --mirror "${repo}" "${basename}"
 fi
 
 GIT_DIR="${basename}" \