Add function get_target_branch.

Change-Id: I2902134639cb50ed10a25f2dffc4f287fc4f3185