git-filter-repo/t/t9391/rename-master-to-develop.py
Elijah Newren 7d42c2093c filter-repo: limit splicing repos warning to test that splices repos
Signed-off-by: Elijah Newren <newren@gmail.com>
2019-06-08 09:05:31 -07:00

19 lines
431 B
Python
Executable File

#!/usr/bin/env python3
"""
Please see the
***** API BACKWARD COMPATIBILITY CAVEAT *****
near the top of git-filter-repo.
"""
import git_filter_repo as fr
def my_commit_callback(commit, metadata):
if commit.branch == b"refs/heads/master":
commit.branch = b"refs/heads/develop"
args = fr.FilteringOptions.default_options()
args.force = True
filter = fr.RepoFilter(args, commit_callback = my_commit_callback)
filter.run()