diff --git a/script/apply_all_patches.py b/script/apply_all_patches.py index ec5b7dbc94..8dd92c6598 100755 --- a/script/apply_all_patches.py +++ b/script/apply_all_patches.py @@ -10,7 +10,7 @@ from lib.patches import patch_from_dir def apply_patches(dirs): for patch_dir, repo in dirs.iteritems(): - git.am(repo=repo, patch_data=patch_from_dir(patch_dir), + git.import_patches(repo=repo, patch_data=patch_from_dir(patch_dir), committer_name="Electron Scripts", committer_email="scripts@electron") diff --git a/script/git-import-patches b/script/git-import-patches index 5401f371a6..3f0fb54a5d 100755 --- a/script/git-import-patches +++ b/script/git-import-patches @@ -17,13 +17,7 @@ def main(argv): help="use 3-way merge to resolve conflicts") args = parser.parse_args(argv) - # save the upstream HEAD so we can refer to it when we later export patches - git.update_ref( - repo='.', - ref='refs/patches/upstream-head', - newvalue='HEAD' - ) - git.am( + git.import_patches( repo='.', patch_data=patch_from_dir(args.patch_dir), threeway=args.threeway diff --git a/script/lib/git.py b/script/lib/git.py index ef2b0bab44..c7deb20439 100644 --- a/script/lib/git.py +++ b/script/lib/git.py @@ -86,6 +86,17 @@ def apply_patch(repo, patch_path, directory=None, index=False, reverse=False): return applied_successfully +def import_patches(repo, **kwargs): + """same as am(), but we save the upstream HEAD so we can refer to it when we + later export patches""" + update_ref( + repo=repo, + ref='refs/patches/upstream-head', + newvalue='HEAD' + ) + am(repo=repo, **kwargs) + + def get_patch(repo, commit_hash): args = ['git', '-C', repo, 'diff-tree', '-p',