@cli.command()<EOL>@pass_config<EOL>def merge(config):
repo = config.repo<EOL>active_branch = repo.active_branch<EOL>if active_branch.name == "<STR_LIT>":<EOL><INDENT>error_out("<STR_LIT>")<EOL><DEDENT>if repo.is_dirty():<EOL><INDENT>error_out(<EOL>'<STR_LIT>'.format(<EOL>"<STR_LIT:U+002CU+0020>".join([repr(x.b_path) for x in repo.index.diff(None)])<EOL>)<EOL>)<EOL><DEDENT>branch_name = active_branch.name<EOL>state = read(config.configfile)<EOL>origin_name = state.get("<STR_LIT>", "<STR_LIT>")<EOL>upstream_remote = None<EOL>for remote in repo.remotes:<EOL><INDENT>if remote.name == origin_name:<EOL><INDENT>upstream_remote = remote<EOL>break<EOL><DEDENT><DEDENT>if not upstream_remote:<EOL><INDENT>error_out("<STR_LIT>".format(origin_name))<EOL><DEDENT>repo.heads.master.checkout()<EOL>upstream_remote.pull(repo.heads.master)<EOL>repo.git.merge(branch_name)<EOL>repo.git.branch("<STR_LIT>", branch_name)<EOL>success_out("<STR_LIT>".format(branch_name))<EOL>info_out("<STR_LIT>")<EOL>info_out("<STR_LIT>")<EOL>push_for_you = input("<STR_LIT>").lower().strip() != "<STR_LIT:n>"<EOL>if push_for_you:<EOL><INDENT>upstream_remote.push("<STR_LIT>")<EOL>success_out("<STR_LIT>".format(upstream_remote.name))<EOL><DEDENT>
Merge the current branch into master.