Only rebuild if branch has changed