- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 2k
Unset GIT_CONFIG
during git config
#858
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
Open
ghost
wants to merge
1
commit into
junegunn:master
Choose a base branch
from
unknown repository
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3
−3
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1625,7 +1625,7 @@ class Plugin(object): | |
self.write(Action.DONE, self.name, result[-1:]) | ||
|
||
def repo_uri(self): | ||
cmd = 'git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url' | ||
cmd = 'git rev-parse --abbrev-ref HEAD 2>&1 && unset GIT_CONFIG && git config remote.origin.url' | ||
command = Command(cmd, self.args['dir'], G_TIMEOUT,) | ||
result = command.execute(G_RETRIES) | ||
return result[-1] | ||
|
@@ -1939,7 +1939,7 @@ function! s:update_ruby() | |
ok, result = | ||
if exists | ||
chdir = "#{cd} #{iswin ? dir : esc(dir)}" | ||
ret, data = bt.call "#{chdir} && git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url", nil, nil, nil | ||
ret, data = bt.call "#{chdir} && git rev-parse --abbrev-ref HEAD 2>&1 && unset GIT_CONFIG && git config remote.origin.url", nil, nil, nil | ||
current_uri = data.lines.to_a.last | ||
if !ret | ||
if data =~ /^Interrupted|^Timeout/ | ||
|
@@ -2054,7 +2054,7 @@ endfunction | |
function! s:git_validate(spec, check_branch) | ||
let err = '' | ||
if isdirectory(a:spec.dir) | ||
let result = s:lines(s:system('git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url', a:spec.dir)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this meant to work on all OS? |
||
let result = s:lines(s:system('git rev-parse --abbrev-ref HEAD 2>&1 && unset GIT_CONFIG && git config remote.origin.url', a:spec.dir)) | ||
let remote = result[-1] | ||
if v:shell_error | ||
let err = join([remote, 'PlugClean required.'], "\n") | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the unset be done before the first
git rev-parse
, I wonder? Could an errantGIT_CONFIG
somehow change how--abbrev-ref
determines the branch name?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re my comment, if that's the case, note that that would be an existing bug rather than a problem introduced by this PR. I think this PR could be merged as is.