Skip to content

Commit

Permalink
accept URLs with long Git tag refs
Browse files Browse the repository at this point in the history
Extends `urlRegex` to accept tags specified with full `refs/tags/*` format.
Note the use of `?:` part to make the group not present in the `matche` list.

The need to reference Git tags with `refs/tags/` prefix is caused by
changes in how Nix `2.4` and newer versions handle Git tags. They expect
tags without full name to be branches, which fails with:
```
fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6
error: program 'git' failed with exit code 128
```

Issue: status-im/status-mobile#12832
PR: status-im/status-mobile#12980

Signed-off-by: Jakub Sokołowski <[email protected]>
  • Loading branch information
jakubgs committed Jan 11, 2022
1 parent e2f4784 commit baa4290
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dependency-check-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async function checkDependenciesAsync(
}

// tslint:disable-next-line:max-line-length
const urlRegex = /^(http:\/\/|https:\/\/|git\+http:\/\/|git\+https:\/\/|ssh:\/\/|git\+ssh:\/\/|github:)([a-zA-Z0-9_\-./]+)(#(.*))?$/gm
const urlRegex = /^(http:\/\/|https:\/\/|git\+http:\/\/|git\+https:\/\/|ssh:\/\/|git\+ssh:\/\/|github:)([a-zA-Z0-9_\-./]+)(#(?:refs\/tags\/)?(.*))?$/gm
const requiredProtocol = 'git+https://'

result.checkedDependencyCount += dependencies.length
Expand Down

0 comments on commit baa4290

Please sign in to comment.