Fix os.rename in git source element to correctly handle error codes
Description
According to the documentation (https://www.unix.com/man-page/POSIX/3posix/rename/), when the directory already is there, either EEXIST or ENOTEMPTY could be thrown. Previously only ENOTEMPTY was checked.
Changes proposed in this merge request:
- Separate the move into its own function
- Check for both errors
- Unit test the function
This merge request, when approved, will close: