Skip to content

Commit 8c98f77

Browse files
committed
Problem: pgpm hangs up on some repo tag listing
Solution: ensure we're not being prompted for a password and fail instead
1 parent 865208e commit 8c98f77

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

lib/pgpm/package/git.rb

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,17 @@ def package_versions
1717
if !git_config.download_version_tags
1818
super
1919
else
20-
@tags ||=
21-
::Git.ls_remote(git_config.url)["tags"].keys
22-
.filter { |key| !key.end_with?("^{}") }
23-
.filter { |key| key.match?(SEMVER) }
20+
git_term_prompt = ENV["GIT_TERMINAL_PROMPT"]
21+
ENV["GIT_TERMINAL_PROMPT"] = "0"
22+
begin
23+
@tags ||=
24+
::Git.ls_remote(git_config.url)["tags"].keys
25+
.filter { |key| !key.end_with?("^{}") }
26+
.filter { |key| key.match?(SEMVER) }
27+
rescue StandardError
28+
@tags ||= []
29+
end
30+
ENV["GIT_TERMINAL_PROMPT"] = git_term_prompt
2431
versions = @tags.map { |tag| tag.gsub(/^v/, "") }.map { |v| Pgpm::Package::Version.new(v) }
2532
@tag_versions = Hash[@tags.zip(versions)]
2633
@version_tags = Hash[versions.zip(@tags)]

0 commit comments

Comments
 (0)