mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 21:00:13 +01:00
Add a --remote switch to new_proposal.py (#4681)
If the user's fork is not named 'origin' then the script will fail and needs to know the user's remote name. Fixes #1899
This commit is contained in:
@@ -55,6 +55,13 @@ def _parse_args(args: Optional[List[str]] = None) -> argparse.Namespace:
|
||||
help="The name of the branch. Automatically generated from the title "
|
||||
"by default.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--remote",
|
||||
metavar="REMOTE",
|
||||
default="origin",
|
||||
help="The git remote name where the branch will be pushed. Defaults to "
|
||||
"'origin'.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--proposals-dir",
|
||||
metavar="PROPOSALS_DIR",
|
||||
@@ -177,7 +184,7 @@ def main() -> None:
|
||||
_run(
|
||||
[git_bin, "switch", "--create", branch, parsed_args.branch_start_point]
|
||||
)
|
||||
_run([git_bin, "push", "-u", "origin", branch])
|
||||
_run([git_bin, "push", "-u", parsed_args.remote, branch])
|
||||
|
||||
# Copy template.md to a temp file.
|
||||
template_path = os.path.join(proposals_dir, "scripts/template.md")
|
||||
|
||||
Reference in New Issue
Block a user