MCPcopy Create free account
hub / github.com/ezyang/ghstack / _git_push

Method _git_push

src/ghstack/submit.py:1928–1948  ·  view source on GitHub ↗
(self, branches: Sequence[str], force: bool = False)

Source from the content-addressed store, hash-verified

1926 return title, pr_body
1927
1928 def _git_push(self, branches: Sequence[str], force: bool = False) -> None:
1929 assert branches, "empty branches would push master, probably bad!"
1930 try:
1931 self.sh.git(
1932 "push",
1933 self.remote_name,
1934 "--no-verify",
1935 *(["--force"] if force else []),
1936 *branches,
1937 )
1938 except RuntimeError as e:
1939 remote_url = self.sh.git("remote", "get-url", "--push", self.remote_name)
1940 if remote_url.startswith("https://"):
1941 raise RuntimeError(
1942 "[E001] git push failed, probably because it asked for password "
1943 "(scroll up to see original error). "
1944 "Change your git URL to use SSH instead of HTTPS to enable passwordless push. "
1945 "See https://github.com/ezyang/ghstack/wiki/E001 for more details."
1946 ) from e
1947 raise
1948 self.github.push_hook(branches)
1949
1950
1951def run_pre_ghstack_hook(

Callers 2

process_commitMethod · 0.95
push_updatesMethod · 0.95

Calls 2

gitMethod · 0.80
push_hookMethod · 0.45

Tested by

no test coverage detected