In the event of a subrepo-push, an upstream update (from elsewhere), then a subrepo-pull, the history rewrite would disconnect HEAD^ from all ancestry.  This commit includes a test for that case, by checking (after the merge in the subrepo-pull) if HEAD^ is equal to HEAD^2^, and not rewriting the history in that case. I am certain an improvement can be done here though, as the resulting "git subrepo pull" commit is different than normal and is quite messy.