reflog: simplify the append logic

Remove some duplicated logic.