fix #14 Compatibility with git v1.7.9.5
Fix, upstream should be correctly calculated with git < v1.8, fix by @celeron55
The if works with git v1.8