Loading tools/aosp/aosp_sha.sh +13 −7 Original line number Original line Diff line number Diff line #!/bin/bash #!/bin/bash LOCAL_DIR="$( dirname ${BASH_SOURCE} )" LOCAL_DIR="$( dirname "${BASH_SOURCE}" )" if git branch -vv | grep "^*" | grep "\[aosp/master" > /dev/null; then if git branch -vv | grep -q -P "^\*[^\[]+\[aosp/"; then # Change appears to be in AOSP # Change appears to be in AOSP exit 0 exit 0 else else # Change appears to be non-AOSP; search for files # Change appears to be non-AOSP; search for files git show --name-only --pretty=format: $1 | grep $2 | while read file; do count=0 while read -r file ; do if (( count == 0 )); then echo echo fi echo -e "\033[0;31mThe source of truth for '$file' is in AOSP.\033[0m" echo -e "\033[0;31mThe source of truth for '$file' is in AOSP.\033[0m" (( count++ )) done < <(git show --name-only --pretty=format: $1 | grep -- "$2") if (( count != 0 )); then echo echo echo "If your change contains no confidential details, please upload and merge" echo "If your change contains no confidential details (such as security fixes), please" echo "this change at https://android-review.googlesource.com/." echo "upload and merge this change at https://android-review.googlesource.com/." echo echo exit 77 exit 77 done fi fi fi Loading
tools/aosp/aosp_sha.sh +13 −7 Original line number Original line Diff line number Diff line #!/bin/bash #!/bin/bash LOCAL_DIR="$( dirname ${BASH_SOURCE} )" LOCAL_DIR="$( dirname "${BASH_SOURCE}" )" if git branch -vv | grep "^*" | grep "\[aosp/master" > /dev/null; then if git branch -vv | grep -q -P "^\*[^\[]+\[aosp/"; then # Change appears to be in AOSP # Change appears to be in AOSP exit 0 exit 0 else else # Change appears to be non-AOSP; search for files # Change appears to be non-AOSP; search for files git show --name-only --pretty=format: $1 | grep $2 | while read file; do count=0 while read -r file ; do if (( count == 0 )); then echo echo fi echo -e "\033[0;31mThe source of truth for '$file' is in AOSP.\033[0m" echo -e "\033[0;31mThe source of truth for '$file' is in AOSP.\033[0m" (( count++ )) done < <(git show --name-only --pretty=format: $1 | grep -- "$2") if (( count != 0 )); then echo echo echo "If your change contains no confidential details, please upload and merge" echo "If your change contains no confidential details (such as security fixes), please" echo "this change at https://android-review.googlesource.com/." echo "upload and merge this change at https://android-review.googlesource.com/." echo echo exit 77 exit 77 done fi fi fi