Added fix for cases when squashing is done on a secondary branch, and when added commits after 'until' contain merge commits