The push_patch() function has a complex control flow and actually does
two different things depending on the 'empty' parameter. This patch
splits it in two functions without other code changes.
Later patches will refactor the code to simplify it.
Signed-off-by: David Kågedal <davidk@lysator.liu.se> Signed-off-by: Karl Hasselström <kha@treskal.com>