Workiva / dpx

Apache License 2.0
1 stars 0 forks source link

Error on subsequent runs when using Git commit as a ref #26

Open greglittlefield-wf opened 1 month ago

greglittlefield-wf commented 1 month ago

Please include the following information:

  • Dart SDK version (dart --version): 2.19.6 (stable) (Tue Mar 28 13:41:04 2023 +0000) on "macos_arm64"
  • dpx version (dpx --version): 0.2.0

When using a commit hash as a Git ref, dpx works the first time, but then fails on subsequent runs.

# First run
% dpx github:Workiva/dpx#ref=746c43b66cd10f17c51c504ffe3bf858e15bbd49 --version
Need to install the following packages:
Git repository "https://github.com/Workiva/dpx.git" at ref "746c43b66cd10f17c51c504ffe3bf858e15bbd49"
Ok to proceed? (y/n) y
0.2.0

# Subsequent run
% dpx github:Workiva/dpx#ref=746c43b66cd10f17c51c504ffe3bf858e15bbd49 --version
Failed to parse resolved ref from output: ""

# Subsequent run with --verbose
% dpx --verbose github:Workiva/dpx#ref=746c43b66cd10f17c51c504ffe3bf858e15bbd49 --version
...
[     0.070s] Checking: GlobalPackage(name: dpx, source: git, version: 0.2.0, url: https://github.com/Workiva/dpx.git, gitPath: ., gitResolvedRef: 746c43b66cd10f17c51c504ffe3bf858e15bbd49, path: null)
[     0.070s] Resolving git ref...
[     1.031s] CMD: git ls-remote https://github.com/Workiva/dpx.git 746c43b66cd10f17c51c504ffe3bf858e15bbd49
STDOUT:

STDERR:

[     1.033s] Failed to parse resolved ref from output: ""
[     1.033s] #0      resolveLatestGitRef (package:dpx/src/resolve_latest_git_ref.dart:40:5)
<asynchronous suspension>
#1      findReusablePackage (package:dpx/src/find_reusable_package.dart:67:33)
<asynchronous suspension>
#2      main (file:///Users/greglittlefield/.pub-cache/git/dpx-746c43b66cd10f17c51c504ffe3bf858e15bbd49/bin/dpx.dart:37:29)
<asynchronous suspension>

It looks like the git ls-remote command being used doesn't output anything for commit hashes, only other ref types.