Jeff Sharkey | 0a9c731 | 2018-08-23 22:01:53 -0600 | [diff] [blame] | 1 | #!/bin/bash |
Jeff Sharkey | 5b47199 | 2018-09-11 10:36:57 -0600 | [diff] [blame] | 2 | LOCAL_DIR="$( dirname "${BASH_SOURCE}" )" |
Jeff Sharkey | 0a9c731 | 2018-08-23 22:01:53 -0600 | [diff] [blame] | 3 | |
Jeff Sharkey | 5b47199 | 2018-09-11 10:36:57 -0600 | [diff] [blame] | 4 | if git branch -vv | grep -q -P "^\*[^\[]+\[aosp/"; then |
Jeff Sharkey | 0a9c731 | 2018-08-23 22:01:53 -0600 | [diff] [blame] | 5 | # Change appears to be in AOSP |
| 6 | exit 0 |
| 7 | else |
| 8 | # Change appears to be non-AOSP; search for files |
Jeff Sharkey | 5b47199 | 2018-09-11 10:36:57 -0600 | [diff] [blame] | 9 | count=0 |
| 10 | while read -r file ; do |
| 11 | if (( count == 0 )); then |
| 12 | echo |
| 13 | fi |
Jeff Sharkey | 0a9c731 | 2018-08-23 22:01:53 -0600 | [diff] [blame] | 14 | echo -e "\033[0;31mThe source of truth for '$file' is in AOSP.\033[0m" |
Jeff Sharkey | 5b47199 | 2018-09-11 10:36:57 -0600 | [diff] [blame] | 15 | (( count++ )) |
| 16 | done < <(git show --name-only --pretty=format: $1 | grep -- "$2") |
| 17 | if (( count != 0 )); then |
Jeff Sharkey | 0a9c731 | 2018-08-23 22:01:53 -0600 | [diff] [blame] | 18 | echo |
Jeff Sharkey | 5b47199 | 2018-09-11 10:36:57 -0600 | [diff] [blame] | 19 | echo "If your change contains no confidential details (such as security fixes), please" |
| 20 | echo "upload and merge this change at https://android-review.googlesource.com/." |
Jeff Sharkey | 0a9c731 | 2018-08-23 22:01:53 -0600 | [diff] [blame] | 21 | echo |
Jeff Sharkey | aaaf1b7 | 2018-12-03 10:56:56 -0700 | [diff] [blame] | 22 | exit 1 |
Jeff Sharkey | 5b47199 | 2018-09-11 10:36:57 -0600 | [diff] [blame] | 23 | fi |
Jeff Sharkey | 0a9c731 | 2018-08-23 22:01:53 -0600 | [diff] [blame] | 24 | fi |