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

fix: download mechanism works with GIT_DIR and GIT_WORK_TREE set #275

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

Bahex
Copy link
Contributor

@Bahex Bahex commented Nov 5, 2024

Explicitly provide --git-dir and --work-tree in git commands.

Issue #274

Explicitly provide `--git-dir` and `--work-tree` in git commands
@Saghen Saghen merged commit 8c9930c into Saghen:main Nov 5, 2024
@Saghen
Copy link
Owner

Saghen commented Nov 5, 2024

Thanks!

@debugloop
Copy link

This seems to break on my machine somehow, I have not had the time to look into it yet. I use the flake to install, and I get the following problem on main. Everything works nicely with 1628800e1747ecc767368cab45916177c723da82 (that is the commit before this PR's merge). It seems repo_dir is nil?

Failed to run `config` for blink.cmp

vim/fs.lua:0: invalid value (nil) at index 1 in table for 'concat'

# stacktrace:
  - vim/fs.lua:0 _in_ **joinpath**
  - .local/share/nvim/nixpkgs/blink-cmp/lua/blink/cmp/fuzzy/download.lua:75 _in_ **get_git_tag**
  - .local/share/nvim/nixpkgs/blink-cmp/lua/blink/cmp/fuzzy/download.lua:23 _in_ **ensure_downloaded**
  - .local/share/nvim/nixpkgs/blink-cmp/lua/blink/cmp/init.lua:8 _in_ **setup**
  - .config/nvim/init.lua:8

@Bahex
Copy link
Contributor Author

Bahex commented Nov 6, 2024

I think I understand what's happening. The flake doesn't keep a ".git" directory around

local repo_dir = vim.fs.root(root_dir, '.git')

so repo_dir is nil.

That line only concerns users who download the compiled binary from github, it should be easy to fix by moving that line into download.get_git_tag().

Thanks for the feedback!

@Bahex
Copy link
Contributor Author

Bahex commented Nov 6, 2024

After a familiarizing myself more with the code, what should happen is repo_dir == nil should trigger the same code path as out.code == 128. Sending another PR shortly.

@Bahex
Copy link
Contributor Author

Bahex commented Nov 6, 2024

@debugloop can you check #281 to see if it works?

@debugloop
Copy link

Works for me, thanks for the quick response and fix 🚀 .git being stripped from a flake at eval time makes sense, yeah 👍🏻

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

Successfully merging this pull request may close these issues.

3 participants