Git pull fix

1) Fixes fast forward pull. #1682 

@ussuri 
Yes a refactoring is long due here.