onefetch icon indicating copy to clipboard operation
onefetch copied to clipboard

Error: repository path is not owned by current user; class=Config(7)

Open Freed-Wu opened this issue 3 years ago • 6 comments
trafficstars

Duplicates

  • [X] I have searched the existing issues

version: 2.12.0

Current behavior 😯

Cannot work in C:/Users/%USERNAME%, but can work in other path. It is not related to shell(both cmd and zsh are tested).

Screenshot from 2022-09-05 14-22-10

Expected behavior 🤔

Same as the following (in linux)

Screenshot from 2022-09-05 14-23-45

Steps to reproduce 🕹

git clone a repo to C:/Users/%USERNAME%, then onefetch

Freed-Wu avatar Sep 05 '22 06:09 Freed-Wu

I think this could be working already in the latest main. Could you try that by compiling onefetch from source? Thank you.

Byron avatar Sep 05 '22 06:09 Byron

My network is not good. Can anyone try? Thanks.

❯ cargo install --git https://github.com/o2sh/onefetch
    Updating git repository `https://github.com/o2sh/onefetch`
warning: spurious network error (2 tries remaining): failed to send request: 操作超时
; class=Os (2)
warning: spurious network error (1 tries remaining): failed to send request: 操作超时
; class=Os (2)
error: failed to fetch into: C:\Users\wzy\.cargo\git\db\onefetch-258c4293dfe669f3

Caused by:
  failed to send request: 操作超时
  ; class=Os (2)

Freed-Wu avatar Sep 05 '22 06:09 Freed-Wu

You could try this (I just pushed the latest main there): cargo install --git https://gitee.com/byronbates/onefetch .

Byron avatar Sep 05 '22 11:09 Byron

In windows,

❯ cargo install --git https://gitee.com/byronbates/onefetch
    Updating git repository `https://gitee.com/byronbates/onefetch`
  Installing onefetch v2.12.0 (https://gitee.com/byronbates/onefetch#a0112434)
    Updating `bfsu` index
error: failed to compile `onefetch v2.12.0 (https://gitee.com/byronbates/onefetch#a0112434)`, intermediate artifacts can be found at `C:\msys64\tmp\cargo-installC5eAG6`

Caused by:
  failed to select a version for the requirement `libgit2-sys = "^0.14.0"`
  candidate versions found which didn't match: 0.13.2+1.4.2, 0.13.1+1.4.2, 0.13.0+1.4.1, ...
  location searched: `bfsu` index (which is replacing registry `crates-io`)
  required by package `git2 v0.15.0`
      ... which satisfies dependency `git2 = "^0.15.0"` of package `onefetch v2.12.0 (C:\Users\wzy\.cargo\git\checkouts\onefetch-bdfc71bcd465f859\a011243)`
  perhaps a crate was updated and forgotten to be re-vendored?

However, in linux, it can work.

Freed-Wu avatar Sep 05 '22 13:09 Freed-Wu

@Byron Do you think this is caused by the git vulnerability patch that now checks the ownership of the .git directory? Is the safe.directory configuration be relevant?

spenserblack avatar Sep 05 '22 15:09 spenserblack

@spenserblack Absolutely, and I would hope that git2 implements save.directory as well but didn't try. @Freed-Wu This is certainly something you can try. Run git config --system save.directory '*' to allow each git repository to get past the check. I don't know why it wouldn't be able to see the latest git2 version, it feels like cargo is offline or failed to update the crates.io index. There should be a mirror on gitee for it, this one seems recent enough.

Byron avatar Sep 06 '22 00:09 Byron

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

o2sh avatar Dec 11 '22 00:12 o2sh