diff --git a/tools/wltests/test_series b/tools/wltests/test_series index 2466f271d0eccba55ae6189df1adbd3e7ec50e59..e9bb9f9e42bd717e4ce6da28dde29ae9a1956207 100755 --- a/tools/wltests/test_series +++ b/tools/wltests/test_series @@ -943,8 +943,22 @@ COMMIT_ID=1 # Here we read from an arbitrary file descriptor 10 to avoid overlaps with # stdin generated by the adb commands in the loop body while read -u10 COMMITS; do - # Extract SHA1 from commit description - COMMIT_SHA1=${COMMITS%% *} + # Extract commit identifier from commit description + COMMIT=${COMMITS%% *} + + # Translate possible branch name to SHA1 + COMMITS=$(git -C $KERNEL_SRC show-ref -s $COMMIT) + if [ $? -ne 0 ]; then + COMMIT_SHA1=$COMMIT + elif [ $(echo $COMMITS | wc -w) -eq 1 ]; then + COMMIT_SHA1=$COMMITS + else + c_error "The branch name must be univocal, \"$COMMIT\" may refer to:" + for b in $(git -C $KERNEL_SRC show-ref $COMMIT | cut -f 2 -d " "); do + c_error " $b" + done + exit $EINVAL + fi box_out "PROGRESS : $COMMIT_ID/$COMMITS_COUNT" \ "COMMIT : $COMMITS"