Skip to content
This repository was archived by the owner on Sep 8, 2023. It is now read-only.

Fix non-fatal error when using the --clone parameter #239

Merged
merged 1 commit into from
Feb 16, 2019

Conversation

rhssk
Copy link

@rhssk rhssk commented Jan 4, 2019

See commit message.

Previous code suspiciously looks like it was intended to only move hidden files starting with .git. If that was really the reason (I can't imagine why though) a different approach might be needed.

Cheers

Not all of hidden repo files were moved to data mount directory, which
later resulted rmdir complaining about the directory to-be-deleted still
containing some files.

It's surprisingly tricky to simply move all files and folders without any
mv errors when using POSIX. This fix is shamelessly stolen from
https://unix.stackexchange.com/questions/6393/how-do-you-move-all-files-including-hidden-from-one-directory-to-another/6397#6397
@aguslr
Copy link
Owner

aguslr commented Feb 16, 2019

Hello, @rhssk! I'm not quite sure I understand what benefit this brings. Currenty only the hidden files that start with .git are copied because those are the only hidden files that exist when cloning the repository.

@rhssk
Copy link
Author

rhssk commented Feb 16, 2019

When using the --clone parameter, only .git, .gitattributes, .gitignore and .gitlab-ci.yml hidden files get moved over. .editorconfig remains in the temporary directory and [ -d "$repo_dir" ] && rmdir "$repo_dir" fails with rmdir: failed to remove '/tmp/repo.XXXX': Directory not empty.

It would be cleaner if all repo files were copied and script doesn't exit with 1.

@aguslr
Copy link
Owner

aguslr commented Feb 16, 2019

Oh, you're right. Wow! I totally forgot about the .editorconfig file. 😲 I guess this is also related to #243.

Thanks for the PR, @rhssk!

@aguslr aguslr merged commit a6ce902 into aguslr:master Feb 16, 2019
@rhssk rhssk deleted the mv_hidden branch February 17, 2019 15:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants