def git_debug_init(args): """ Initialize a git repository in the output directory and commit the current code in it. This is only used for debugging the transformations this code will do to the output later. """ if not args.gitdebug: return git.init(tree=args.outdir) git.commit_all("Copied backport", tree=args.outdir)
def git_debug_init(args): """ Initialize a git repository in the output directory and commit the current code in it. This is only used for debugging the transformations this code will do to the output later. """ if not args.gitdebug: return # Git supports re-initialization, although not well documented it can # reset config stuff, lets avoid that if the tree already exists. if not os.path.exists(os.path.join(args.bpid.project_dir, '.git')): git.init(tree=args.bpid.project_dir) git.commit_all("Copied backport", tree=args.bpid.project_dir)