Ability to checkout ref branch added.

Change-Id: Iab9a88621283a23063a4c3c558ee3fb31a29514c