Adaptive branching in source-sink habitats