BUG: Index with right_index=True or left_index=True merge
- [x] xref #28243 
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Hi,

I would expect the output form the merge function as specified in #28243, i.e. if you join right with right_index=True the resulting DataFrame should have the right index.

The documentation says, that the index is passed on if it is part of the merge.

This change broke a few test, which expected in this case that the index was the index which was merged onto the base DataFrame. I fixed them temporarily until I know how to proceed in this case.

Should this as implemented be the desired behavior for the right_index=True case? 

The code is not final, it is just a first draft. I would have to change the tests for good after we decide how to implement this.