Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npins add git breaks if both --at <rev> and --branch are given #75

Open
stuebinm opened this issue May 6, 2024 · 0 comments
Open

npins add git breaks if both --at <rev> and --branch are given #75

stuebinm opened this issue May 6, 2024 · 0 comments

Comments

@stuebinm
Copy link
Contributor

stuebinm commented May 6, 2024

This should probably just raise an error when doing npins add git; either one uses it with --at <rev> --branch <name> or with --at <tag>. But currently, giving both appears to work, until it doesn't:

❯ npins init --bare
[INFO ] Welcome to npins!
[INFO ] Creating `npins` directory
[INFO ] Writing default.nix
[INFO ] Writing initial sources.json (empty)
[INFO ] Successfully written initial files to 'npins'.

❯ npins add git https://stuebinm.eu/git/nixq --at 0.0.2 --branch main
[INFO ] Adding 'nixq' …
    repository: https://stuebinm.eu/git/nixq
    branch: main
    revision: 0.0.2
    hash: 187p0i8dxy4glk8g1hwfvm8vl4pgfv9qj3lmy4rh8vjvygcqx8p1

❯ nix-instantiate --eval npins -A nixq.outPath
error:
       … while calling the 'fetchGit' builtin
         at /tmp/flake/npins/default.nix:26:43:
           25|       })
           26|     else assert repository.type == "Git"; builtins.fetchGit {
             |                                           ^
           27|       url = repository.url;

       error: hash '0.0.2' has wrong length for hash type 'sha1'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant