Skip to content
Merged
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
19 changes: 12 additions & 7 deletions src/taskgraph/util/vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,15 +612,20 @@ def get_note(
note = f"refs/notes/{note}"

try:
self.run("fetch", remote, f"{note}:{note}")
self.run("fetch", remote, f"{note}:{note}", stderr=subprocess.PIPE)
except subprocess.CalledProcessError:
ls = subprocess.run(
["git", "ls-remote", "--exit-code", remote, note],
cwd=self.path,
capture_output=True,
ls_output = self.run(
"ls-remote",
"--exit-code",
remote,
note,
return_codes=(2,),
stderr=subprocess.PIPE,
)
# If the note doesn't exist, ignore the fetch failure
if ls.returncode == 2:
if not ls_output:
logger.info(
"Failed to fetch %s but the remote doesn't have it. Ignoring.", note
)
return None
raise

Expand Down
Loading