This is an automated email from the ASF dual-hosted git repository.

dcapwell pushed a commit to branch cep-15-accord
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cep-15-accord by this push:
     new a052e062d2 Ninja: .build/include-accord.sh was trying to do pull 
--rebase on a SHA and fail as git doesnt know how to do that.  Switched to git 
fetch then checkout SHA
a052e062d2 is described below

commit a052e062d22c3363dfd12f9cf35efe278fe194a7
Author: David Capwell <[email protected]>
AuthorDate: Thu Feb 2 14:01:33 2023 -0800

    Ninja: .build/include-accord.sh was trying to do pull --rebase on a SHA and 
fail as git doesnt know how to do that.  Switched to git fetch then checkout SHA
---
 .build/include-accord.sh | 24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)

diff --git a/.build/include-accord.sh b/.build/include-accord.sh
index a1e3a580af..5609ea0585 100755
--- a/.build/include-accord.sh
+++ b/.build/include-accord.sh
@@ -25,31 +25,25 @@ set -o nounset
 bin="$(cd "$(dirname "$0")" > /dev/null; pwd)"
 
 accord_repo='https://github.com/apache/cassandra-accord.git'
-accord_branch='0cc9e273b2eaa37d82a1ae1ac2681aec65aa0f6d'
+accord_sha='0cc9e273b2eaa37d82a1ae1ac2681aec65aa0f6d'
 accord_src="$bin/cassandra-accord"
 
-checkout() {
-  cd "$accord_src"
-    git checkout "$accord_branch"
-    echo "$accord_branch" > .BRANCH
-  cd -
-}
-
 _main() {
   # have we already cloned?
   if [[ ! -e "$accord_src" ]] || [[ $(cat "$accord_src/.REPO" || true) != 
"$accord_repo" ]]; then
     rm -rf "$accord_src" || true
     git clone "$accord_repo" "$accord_src"
     echo "$accord_repo" > "$accord_src/.REPO"
-    checkout
-  fi
-  if [[ $(cat "$accord_src"/.BRANCH || true) != "$accord_branch" ]]; then
-    checkout
   fi
   cd "$accord_src"
-  # are there changes?
-  git pull --rebase origin "$accord_branch"
-  if [[ $(git rev-parse HEAD) != $(cat .SHA || true) ]]; then
+  # switch to target SHA
+  git fetch origin # check for changes
+  local current_sha
+  current_sha="$(git rev-parse HEAD)"
+  if [[ "$current_sha" != "$accord_sha" ]]; then
+    git checkout "$accord_sha"
+  fi
+  if [[ "$accord_sha" != $(cat .SHA || true) ]]; then
     ./gradlew clean install -x test -x rat
     git rev-parse HEAD > .SHA
   fi


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to