Fix double-history-rebase bug in document sharing

Add test.
Remove stray conflict marker