Skip to content

Commit

Permalink
Ignore dangling warning in stale_refs
Browse files Browse the repository at this point in the history
If pruning a remote ref git outputs a warning if this would make
another ref dangling. We're not interested in this information in
stale_refs so ignore this case.
  • Loading branch information
tobiashenkel authored and westphahl committed Dec 7, 2023
1 parent 44102f3 commit 9374dbc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions git/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,10 @@ def stale_refs(self) -> IterableList[Reference]:
# expecting
# * [would prune] origin/new_branch
token = " * [would prune] "
# Valid output also can be
# <ref> will become dangling!
if 'will become dangling!' in line:
continue
if not line.startswith(token):
continue
ref_name = line.replace(token, "")
Expand Down

0 comments on commit 9374dbc

Please sign in to comment.