devops: fix prepare_checkout script (#14198)
Instead of checking repository for the existance of a commit sha, we should make sure that our remote branch has the commit. Otherwise, the `export.sh` script later on would not work!
This commit is contained in:
Родитель
9159ceafb5
Коммит
0d2583f0d3
|
@ -189,8 +189,8 @@ else
|
|||
git remote rename origin $REMOTE_BROWSER_UPSTREAM
|
||||
fi
|
||||
|
||||
# Check if our checkout contains BASE_REVISION.
|
||||
if ! git cat-file -e "$BASE_REVISION"^{commit} 2>/dev/null; then
|
||||
# if our remote branch does not contains "BASE_REVISION" - then fetch more stuff.
|
||||
if [[ -z $(git branch -r --contains "${BASE_REVISION}" --list "${REMOTE_BROWSER_UPSTREAM}/${BASE_BRANCH}") ]]; then
|
||||
# Detach git head so that we can fetch into branch.
|
||||
git checkout --detach >/dev/null 2>/dev/null
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче