We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc83822 commit 07acc06Copy full SHA for 07acc06
osc/gitea_api/git.py
@@ -156,7 +156,10 @@ def get_branch_head(self, branch: Optional[str] = None) -> str:
156
if not branch:
157
branch = self.current_branch
158
159
- return self._run_git(["rev-parse", f"refs/heads/{branch}"])
+ try:
160
+ return self._run_git(["rev-parse", f"refs/heads/{branch}"], mute_stderr=True)
161
+ except subprocess.CalledProcessError:
162
+ raise exceptions.GitObsRuntimeError(f"Unable to retrieve HEAD from branch '{branch}'. Does the branch exist?")
163
164
def branch_exists(self, branch: str) -> bool:
165
try:
0 commit comments