@@ -594,7 +594,6 @@ def git_checkout(
594594 destination_path : str ,
595595 head_repo : str ,
596596 base_repo : Optional [str ],
597- base_ref : Optional [str ],
598597 base_rev : Optional [str ],
599598 ref : Optional [str ],
600599 commit : Optional [str ],
@@ -642,29 +641,14 @@ def git_checkout(
642641
643642 retry_required_command (b"vcs" , args , extra_env = env )
644643
645- if base_ref :
646- args = ["git" , "fetch" , "origin" , base_ref ]
647-
648- retry_required_command (b"vcs" , args , cwd = destination_path , extra_env = env )
649-
650- # Create local branch so that taskgraph is able to compute differences
651- # between the head branch and the base one, if needed
652- args = ["git" , "checkout" , base_ref ]
653-
654- retry_required_command (b"vcs" , args , cwd = destination_path , extra_env = env )
655-
656- # When commits are force-pushed (like on a testing branch), base_rev doesn't
657- # exist on base_ref. Fetching it allows taskgraph to compute differences
658- # between the previous state before the force-push and the current state.
659- #
660- # Unlike base_ref just above, there is no need to checkout the revision:
661- # it's immediately available after the fetch.
644+ # Fetching base_rev allows Taskgraph to compute the files changed by the
645+ # push.
662646 if base_rev and base_rev != NULL_REVISION :
663647 args = ["git" , "fetch" , "origin" , base_rev ]
664648
665649 retry_required_command (b"vcs" , args , cwd = destination_path , extra_env = env )
666650
667- # Fetch ref
651+ # Fetch head ref
668652 args = ["git" , "fetch" ]
669653 if ref and base_repo == head_repo :
670654 # If a ref was provided, it might be tag, so we need to make sure we fetch
@@ -878,7 +862,6 @@ def collect_vcs_options(args, project, name):
878862
879863 repo_type = os .environ .get ("%s_REPOSITORY_TYPE" % env_prefix )
880864 base_repo = os .environ .get ("%s_BASE_REPOSITORY" % env_prefix )
881- base_ref = os .environ .get ("%s_BASE_REF" % env_prefix )
882865 base_rev = os .environ .get ("%s_BASE_REV" % env_prefix )
883866 head_repo = os .environ .get ("%s_HEAD_REPOSITORY" % env_prefix )
884867 revision = os .environ .get ("%s_HEAD_REV" % env_prefix )
@@ -911,7 +894,6 @@ def collect_vcs_options(args, project, name):
911894 "checkout" : checkout ,
912895 "sparse-profile" : sparse_profile ,
913896 "base-repo" : base_repo ,
914- "base-ref" : base_ref ,
915897 "base-rev" : base_rev ,
916898 "head-repo" : head_repo ,
917899 "revision" : revision ,
0 commit comments