]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
download/git: be sure we do fetch something
authorYann E. MORIN <yann.morin.1998@free.fr>
Thu, 19 Apr 2018 20:51:28 +0000 (22:51 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 19 Apr 2018 21:10:24 +0000 (23:10 +0200)
The different versions of git will behave in different ways when
fetching remote references, as summarised by the table below:

              |     ancient git         | new git
--------------------------------------------------------------------
git fetch     | fetch all refs but tags | fetches all refs but tags
git fetch -t  | fetches only tags       | fetch all refs and tags

(git-fetch may still fetch tags, but only if reachable from a branch)

So, to cover all the bases, we do a simple fetch, to be sure we have
branches, followed by the existing fetch -t, to get extra tags.

Fixes:
    http://autobuild.buildroot.net/results/0a2/0a238a7f55ea56c33b639ad03ed5796143426889/build-end.log

Reported-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
support/download/git

index 11723101866cfe475d2f135c17be9da7af6efd7b..c48ad36b1af2e4850e0bf1d2f1c7e30ddac5159b 100755 (executable)
@@ -81,6 +81,7 @@ if [ -n "$(_git ls-remote origin "'${cset}'" 2>&1)" ]; then
 fi
 if [ ${git_done} -eq 0 ]; then
     printf "Fetching all references\n"
+    _git fetch origin
     _git fetch origin -t
 fi