Fix, upstream should be correctly calculated with git < v1.8, fix by @celeron55