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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

gix fails to recognize bare repos that have an index file as bare if they are not named <repo>.git #980

Closed
eatradish opened this issue Aug 16, 2023 · 4 comments
Assignees
Labels
acknowledged an issue is accepted as shortcoming to be fixed

Comments

@eatradish
Copy link
Contributor

eatradish commented Aug 16, 2023

Current behavior 馃槸

My step:

gix clone --bare https://github.com/AOSC-Dev/oma oma-bare
mkdir oma-not-bare
cd oma-not-bare
git init
git --git-dir ../oma-bare --work-tree . checkout -f e8f56b5
cd ../oma-bare
gix fetch origin +refs/heads/*:refs/heads/*

gix return error:

Error: './.git/objects' wasn't a directory

Expected behavior 馃

git success to run:

$ git fetch origin +refs/heads/*:refs/heads/*
from https://github.com/AOSC-Dev/oma
 * [new branch]          cratify-oma -> cratify-oma
$ echo $?
0

Steps to reproduce 馃暪

No response

@Byron Byron added the acknowledged an issue is accepted as shortcoming to be fixed label Aug 16, 2023
@Byron
Copy link
Owner

Byron commented Aug 16, 2023

Thanks for reporting! I can reproduce the issue and noticed that what matters here is the fact that a bare repository isn't called repo.git, but repo-bare in this case the actual problem is the index file present in the bare repo and the fact that it has been renamed to not <repo>.git.

Apparently it's fooled into thinking the repo is indeed having a working tree, and goes off the rails from there.

@Byron Byron self-assigned this Aug 16, 2023
@Byron Byron changed the title gix fetch return error './.git/objects' wasn't a directory with bare repo gix fails to recognize bare repos not named repo.git as bare, be thinks there is a working tree Aug 16, 2023
@Byron Byron changed the title gix fails to recognize bare repos not named repo.git as bare, be thinks there is a working tree gix fails to recognize bare repos that have an index file as bare Aug 16, 2023
@Byron Byron changed the title gix fails to recognize bare repos that have an index file as bare gix fails to recognize bare repos that have an index file as bare if they are not named <repo>.git Aug 16, 2023
@Byron Byron mentioned this issue Aug 16, 2023
Byron added a commit that referenced this issue Aug 16, 2023
#980)

In order to be very sure it's the correct guess, we have to open and quick-parse
a the bare line.
Byron added a commit that referenced this issue Aug 16, 2023
#980)

In order to be very sure it's the correct guess, we have to open and quick-parse
a the bare line.
@Byron
Copy link
Owner

Byron commented Aug 16, 2023

This is fixed in main, please try again to validate. Thank you.

@Byron
Copy link
Owner

Byron commented Aug 16, 2023

I could verify it with gix and the example provided here isn't reproducible anymore. Thanks again for sharing this case.

@eatradish
Copy link
Contributor Author

eatradish commented Aug 27, 2023

Hi, I seem to have another problem after upgrading gitoxide to 0.29.0:

$ gix fetch origin +refs/heads/*:refs/heads/*
Error: Cannot find a remote for unborn branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledged an issue is accepted as shortcoming to be fixed
Projects
None yet
Development

No branches or pull requests

2 participants