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

config: fix worktree git config dir path #775

Merged
merged 1 commit into from
Jan 12, 2022

Conversation

bmeneg
Copy link
Collaborator

@bmeneg bmeneg commented Jan 5, 2022

The config code doesn't follow the worktree git config file when the
user calls for a command that depends on that from within a
git worktree directory. In this cases, the .git path is in fact a file
instead of a valid directory, which turns to point to the actual
worktree configuration dir.

Instead of realying in a hardcoded path (.git/lab), make use of the
git rev-parse --git-dir command already available in the git commands
code (internal/git/git.go) and which follows the worktree situation.

Signed-off-by: Bruno Meneguele bmeneg@redhat.com

Fixes #773

The config code doesn't follow the worktree git config file when the
user calls for a command that depends on that from within a `git
worktree` directory. In this cases, the .git path is in fact a file
instead of a valid directory, which turns to point to the actual
worktree configuration dir.

Instead of realying in a hardcoded path (`.git/lab`), make use of the
`git rev-parse --git-dir` command already available in the git commands
code (internal/git/git.go) and which follows the worktree situation.

Signed-off-by: Bruno Meneguele <bmeneg@redhat.com>
@bmeneg bmeneg requested review from prarit and zampierilucas January 5, 2022 20:08
@codecov
Copy link

codecov bot commented Jan 5, 2022

Codecov Report

Merging #775 (1a10490) into master (e95cb81) will increase coverage by 0.03%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #775      +/-   ##
==========================================
+ Coverage   55.05%   55.08%   +0.03%     
==========================================
  Files          77       77              
  Lines        5584     5588       +4     
==========================================
+ Hits         3074     3078       +4     
- Misses       2226     2227       +1     
+ Partials      284      283       -1     
Impacted Files Coverage Δ
internal/config/config.go 23.71% <0.00%> (-0.50%) ⬇️
cmd/fork.go 63.15% <0.00%> (+5.26%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e95cb81...1a10490. Read the comment docs.

@bmeneg bmeneg merged commit bf54583 into zaquestion:master Jan 12, 2022
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.

lab 0.23.0: `mr show -c' fails in git worktree
2 participants