-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
I was getting many of those chdir warnings. To stop them, I removed the surrounding Dir.chdir @git_path do so this:
Dir.chdir @git_path do
# This is fast, but only works on locally checked out branches
`git show-ref --verify --quiet 'refs/heads/#{branch}'`
return true if $?.exitstatus == 0
# This is slow and will only get called for remote branches.
result = `git ls-remote --heads origin 'refs/heads/#{branch}'`
return result.strip.length != 0
endbecomes this:
# This is fast, but only works on locally checked out branches
`git --git-dir #{@git_path}/.git show-ref --verify --quiet 'refs/heads/#{branch}'`
return true if $?.exitstatus == 0
# This is slow and will only get called for remote branches.
result = `git --git-dir #{@git_path}/.git ls-remote --heads origin 'refs/heads/#{branch}'`
return result.strip.length != 0Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels