Issue #11278 has been reported by FROMENT Michael.

----------------------------------------
Bug #11278: rm on git repo
https://projects.puppetlabs.com/issues/11278

Author: FROMENT Michael
Status: Unreviewed
Priority: Normal
Assignee: 
Category: vcsrepo
Target version: 2.7.x
Affected Puppet version: 2.7.3
Keywords: git vcsrepo rm latest pull checkout
Branch: 


I have the following error when I do a "git rm file" on a repo that keep latest 
with puppet:

Here is my conf :
        vcsrepo { "/etc/bind":
                source => 
"git+ssh://hostname/srv/repositories/git/servers/repo1.git",
                ensure => latest,
                provider => git,
                owner => root,
                group => root,
                force => true,
                }


Here is the error message:

err: /Stage[main]/Blackhole/Vcsrepo[/etc/bind]/ensure: change from present to 
latest failed: Execution of '/usr/bin/git checkout -b 
e725e761e5c6c04063a9a610c0414606f2149a54 --track 
origin/e725e761e5c6c04063a9a610c0414606f2149a54' returned 128: fatal: git 
checkout: updating paths is incompatible with switching branches.
Did you intend to checkout 'origin/e725e761e5c6c04063a9a610c0414606f2149a54' 
which can not be resolved as commit?

For testing I've modify the 
puppetlabs-vcsrepo-0.0.4/lib/puppet/provider/vcsrepo/git.rb like that and it 
seems to solve my problem:

  def checkout_or_reset(revision = @resource.value(:revision))
    if local_branch_revision?
      reset(revision)
    elsif tag_revision?
      at_path { git_with_identity('checkout', revision) }
    elsif remote_branch_revision?
      #at_path { git_with_identity('checkout', '-b', revision, '--track', 
"origin/#{revision}") }
      # Modified by MFROMENT suite petage cable
      at_path { git_with_identity('pull') }
    end
  end


Could you help me with this error ?

Kind regards

Michael 


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to