fast-forward-master.sh: Use a separate dir for R/W clone/push
Currently, when running this script, we get "fatal: destination path
'trusted-firmware-a' already exists and is not an empty directory" error.
Apparently, a dir of this name is already used by R/O checkout for the
build process. So, use another name.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Change-Id: I5d5290acae27331338b715c0dfc3810e795a0295
diff --git a/script/scratch_scripts/fast-forward-master.sh b/script/scratch_scripts/fast-forward-master.sh
index ef010e3..8f0f8e7 100755
--- a/script/scratch_scripts/fast-forward-master.sh
+++ b/script/scratch_scripts/fast-forward-master.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
-# Copyright (c) 2020, Arm Limited. All rights reserved.
+# Copyright (c) 2020-2022, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -9,8 +9,11 @@
set -ex
-git clone ssh://$CI_BOT_USERNAME@review.trustedfirmware.org:29418/TF-A/trusted-firmware-a
-cd trusted-firmware-a
+# Use a directory which won't clash with a r/o clone made for building.
+clone_dir=trusted-firmware-a-for-update
+
+git clone ssh://$CI_BOT_USERNAME@review.trustedfirmware.org:29418/TF-A/trusted-firmware-a ${clone_dir}
+cd ${clone_dir}
git checkout master
git merge --ff-only origin/integration
@@ -21,4 +24,4 @@
fi
cd ..
-rm -rf trusted-firmware-a
+rm -rf ${clone_dir}