MCPcopy Create free account
hub / github.com/microsoft/debugpy / branch

Function branch

subrepo.py:125–144  ·  view source on GitHub ↗
(message: str)

Source from the content-addressed store, hash-verified

123
124
125def branch(message: str) -> None:
126 current_commit = get_current_commit()
127
128 # Remove the temporary branch and worktree.
129 invoke_call("git", "subrepo", "clean", _SUBREPO_NAME)
130 # Ensure we have all of the subrepo refs.
131 invoke_call("git", "subrepo", "fetch", _SUBREPO_NAME)
132 # Populate the subrepo/src/debugpy/_vendored/pydevd branch with new changes.
133 invoke_call("git", "subrepo", "branch", _SUBREPO_NAME)
134
135 # Enter worktree; changes here are applied to the subrepo/src/debugpy/_vendored/pydevd branch.
136 with cwd(_SUBREPO_TMP):
137 # Remove all commits after the last pull and restage the difference.
138 invoke_call("git", "reset", "--soft", current_commit)
139
140 hasModifiedFile = invoke_output("git", "status","-s").strip()
141
142 if hasModifiedFile:
143 # Commit changes with a new message.
144 invoke_call("git", "commit", "-m", message)
145
146
147def push_to_fork(fork_remote: str, fork_branch: str) -> None:

Callers 1

mainFunction · 0.85

Calls 4

get_current_commitFunction · 0.85
invoke_callFunction · 0.85
invoke_outputFunction · 0.85
cwdFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…