puppetlabs/puppetlabs-vcsrepo — pull request #47 by anl (2012-12-28 16:45:47+00:00)
Title: Repo directory not created as specified, non-root user; "git init" then fails

The following snippet:

```puppet
vcsrepo { "/home/git/bind.git":
ensure => bare,
provider => git,
user => 'git',
}
```

Results in

```
Error: Execution of '/bin/su git -c git init --bare' returned 1: /home/git/bind.git/refs: Permission denied

Error: /Stage[main]/Bind::Git/Vcsrepo[/home/git/bind.git]/ensure: change from absent to bare failed: Execution of '/bin/su git -c git init --bare' returned 1: /home/git/bind.git/refs: Permission denied
```

This is because /home/git/bind.git is created root:root, but "git init" is run as the specified user:

```
> ls -l /home/git
total 4
drwxr-xr-x 2 root root 4096 Dec 28 07:44 bind.git
```

I think the attached commits fix this - thanks for considering them.

-Andy