Skip to content

Fix os.rename in git source element to correctly handle error codes

Benjamin Schubert requested to merge bschubert/fix-atomic-move-git-repo into master

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:


Edited by Benjamin Schubert

Merge request reports