Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions progress/apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,10 @@ def push_target(roadmap_dir, repo=gh.ROADMAP_REPO):
login = gh.gh(["api", "user", "--jq", ".login"]).strip()
if not login:
raise RuntimeError("could not determine the authenticated login, so no fork can be used")
# `--clone=false` is idempotent: it creates the fork if absent and is a no-op if it exists.
gh.gh(["repo", "fork", repo, "--clone=false", "--remote=false"])
# With an explicit repository, `--clone=false` is the complete non-interactive form: current
# `gh` rejects `--remote` (even `--remote=false`) when a repository argument is present. This is
# also idempotent: it creates the fork if absent and is a no-op if it exists.
gh.gh(["repo", "fork", repo, "--clone=false"])

# Identify the fork by ANCESTRY, never by name. Two guesses would both be wrong: a fork can be
# renamed, so `<login>/<name>` may not exist; and `<login>/<name>` may exist while being an
Expand Down
3 changes: 2 additions & 1 deletion tests/test_apply_announce.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ class P:
finally:
apply_mod.gh.gh, apply_mod._run = orig_gh, orig_run
assert (remote, owner) == ("fork", "someone")
assert ["repo", "fork", "TauCetiProject/TauCetiRoadmap", "--clone=false", "--remote=false"] in calls
fork_calls = [args for args in calls if args[:2] == ["repo", "fork"]]
assert fork_calls == [["repo", "fork", "TauCetiProject/TauCetiRoadmap", "--clone=false"]]


# ----- a stranger must not be able to lock a window ---------------------------------------------
Expand Down