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

Fix git pull for external_components #2055

Merged
merged 1 commit into from
Jul 22, 2021

Conversation

mmakaay
Copy link
Member

@mmakaay mmakaay commented Jul 22, 2021

What does this implement/fix?

Some refactoring was done on the external_components code between v1.19.4 and v1.20.0, which broke the git pull that is done when the refresh time has passed. The error that now pops up looks like:

external_components: [source xxxxxxxxx.yaml:xxx]
  - [source xxxxxxxxx.yaml:xxx]
    
    not a git repository (or any of the parent directories): .git.                                             

The underlying issue is that the subprocess that is used for running various git commands does not use the directory where the external component is cloned as its working directory.
The change in this pull request fixes the issue.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Related issue or feature (if applicable): fixes

Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#

Test Environment

  • ESP32
  • ESP8266

Example entry for config.yaml:

# Example config.yaml
external_components:
  - source:
      type: git
      url: https://github.com/mmakaay/esphome-xiaomi_bslamp2
      ref: main
    refresh: 1s

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

Copy link
Member

@OttoWinter OttoWinter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, sorry for the regression. Thanks! 😀

@OttoWinter OttoWinter merged commit 8094952 into esphome:dev Jul 22, 2021
jesserockz pushed a commit that referenced this pull request Jul 26, 2021
This was referenced Jul 26, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Sep 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants