Skip to content

git.detached is always fired even when there are no changes #38092

@Magomogo

Description

@Magomogo

Description of Issue/Question

Using git.detached I expect this state not to be applied when working copy already has desired commit checked out. But it's triggered every time.

Setup

test-detached.sls:

https://github.com/Magomogo/days-interval:
  git.detached:
    - ref: 'v0.1.0'
    - target: /tmp/days-interval

Steps to Reproduce Issue

Execute this state:

$ salt-call state.apply test-detached
local:
----------
          ID: https://github.com/Magomogo/days-interval
    Function: git.detached
      Result: True
     Comment: Commit ID 5289e24094da8109f0e061c38ed601fa20201426 was checked out at /tmp/days-interval
     Started: 05:04:59.808246
    Duration: 1705.775 ms
     Changes:
              ----------
              HEAD:
                  ----------
                  new:
                      e7c9f32981ec807776b4e9d6cd9f59734c8c1e3b
                  old:
                      e7c9f32981ec807776b4e9d6cd9f59734c8c1e3b

Summary for local
------------
Succeeded: 1 (changed=1)
Failed:    0
------------
Total states run:     1
Total run time:   1.706 s

### Versions Report

$ git --version
git version 2.1.4

$ sudo salt-call --versions-report
Salt Version:
Salt: 2016.11.0

Dependency Versions:
cffi: 0.8.6
cherrypy: Not Installed
dateutil: 2.2
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.7.3
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.2
mysql-python: 1.2.3
pycparser: 2.10
pycrypto: 2.6.1
pygit2: Not Installed
Python: 2.7.9 (default, Jun 29 2016, 13:08:31)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 14.4.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.5

System Versions:
dist: debian 8.6
machine: x86_64
release: 3.16.0-4-amd64
system: Linux
version: debian 8.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    Corerelates to code central or existential to SaltState-Modulebugbroken, incorrect, or confusing behaviorpending-community-assignmentPending community contributor assignmentseverity-low4th level, cosemtic problems, work around exists

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions