1#!/bin/bash
2
3# Script that cleans up branches created by ojluni_merge_to_main. They are
4# usually name something like 'expected_upstream_e0bywxovb5'.
5
6if [[ -z "${ANDROID_BUILD_TOP}" ]]
7then
8  echo -e "ANDROID_BUILD_TOP not found. You need to run lunch first."
9  exit 1
10fi
11
12pushd "${ANDROID_BUILD_TOP}/libcore"
13
14for br in $(git branch | grep -E "^\s*expected_upstream_[a-z0-9]+$")
15do
16  echo git branch -D ${br}
17  git branch -D ${br}
18done
19
20popd
21