Don't show `error: No such remote: 'origin'` error when building for the
first time and the cached git repository doesn't a remote yet.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
| ... | ... |
@@ -13,7 +13,7 @@ if curl --head --silent --fail "${DOWNLOAD_URL}" 1> /dev/null 2>&1; then
|
| 13 | 13 |
mv docker/docker "${outdir}/docker"
|
| 14 | 14 |
else |
| 15 | 15 |
git init -q . |
| 16 |
- git remote remove origin || true |
|
| 16 |
+ git remote remove origin 2> /dev/null || true |
|
| 17 | 17 |
git remote add origin "${repository}"
|
| 18 | 18 |
git fetch -q --depth 1 origin "${version}" +refs/tags/*:refs/tags/*
|
| 19 | 19 |
git checkout -fq "${version}"
|