Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move git folder on path change #99

Merged
merged 4 commits into from
Oct 19, 2018

Conversation

pyasi
Copy link
Contributor

@pyasi pyasi commented Oct 19, 2018

Copy the .git folder and .gitignore file to a new path when creating a new destination path for you backups.

Copy link
Owner

@alichtman alichtman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, with a few minor changes.

print(Fore.BLUE + "Moving git repo to new destination" + Style.RESET_ALL)
except FileNotFoundError as e:
if not made_new_config:
print(Fore.RED + Style.NORMAL + "Could not detect {}... will initialize".format(e.filename) + Style.RESET_ALL)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove this print statement.

try:
shutil.move(git_dir, new_path)
shutil.move(git_ignore_file, new_path)
print(Fore.BLUE + "Moving git repo to new destination" + Style.RESET_ALL)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print(Fore.BLUE + "Moving git repo to new destination" + Style.RESET_ALL)
print(Fore.BLUE + Style.BRIGHT + "Moving git repo to new destination..." + Style.RESET_ALL)

shallow_backup.py Show resolved Hide resolved
tests/test_git_folder_moving.py Show resolved Hide resolved
@alichtman
Copy link
Owner

Progress on #89

@alichtman
Copy link
Owner

Great work, again. Merging this in.

@alichtman alichtman merged commit 77f4607 into alichtman:master Oct 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants