Fix issue when git repository was not on the branch and can not make pull