git.detached does not work with commit ID as ref #34371
Labels
Bug
broken, incorrect, or confusing behavior
Core
relates to code central or existential to Salt
Execution-Module
fixed-pls-verify
fix is linked, bug author to confirm fix
P4
Priority 4
severity-medium
3rd level, incorrect or bad functionality, confusing and lacks a work around
State-Module
Milestone
Description of Issue/Question
Attempting to use the state
git.detached
with the specific commit ID4b2527720397c0a9f4af8071b1ae65f4dd6c91ab
as theref
parameter gives the following error:This is caused by incorrect parameters passed to
git.describe
ingit.detached
. The revision is passed as the first parameter, while the function expects CWD as the first parameter. Fixing this gave a second error:This was fixed by adding
--always
to thegit describe
call. I will submit a pull request shortly. I do not know if this behaviour change will break any other code.Steps to Reproduce Issue
State file
vim/init.sls
:Run with
salt '*' state.sls_id salt-vim vim
Log after first run:Caused by missing
cwd
parameter forgit.describe
. Fixing this gave the following log:Versions Report
Git: 2.7.4
The text was updated successfully, but these errors were encountered: