carlhuda/bundler — Issue #1650: 'git fetch' is broken when 'bundle install' runs from a git merge rule
Author: ndbroadbent
Created: 2012-02-03 05:12:58+00:00
State: open

* **Bundler version 1.1.rc.7**
* **Ruby 1.9.2p290**

I am using a git merge rule to automatically resolve conflicts in `Gemfile.lock`.

`~/.gitconfig`:

```
[merge "bundleinstall"]
name = runs bundle install to generate Gemfile.lock
driver = bundle install
```

and in `app/.git/info/attributes`:

```
Gemfile.lock merge=bundleinstall
```

Here's the output from bundler when a conflict happens:

```
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Updating git://github.com/crossroads/crm_mingle.git
fatal: Not a git repository: '.git'
Git error: command `git fetch --force --quiet --tags 'git://github.com/crossroads/crm_mingle.git' "refs/heads/*:refs/heads/*"` in directory /home/ndbroadbent/.rvm/gems/ruby-1.9.2-p290/cache/bundler/git/crm_mingle-54cf84d4b1c69511512a16389eee687deb8abe92 has failed.
If this error persists you could try removing the cache directory '/home/ndbroadbent/.rvm/gems/ruby-1.9.2-p290/cache/bundler/git/crm_mingle-54cf84d4b1c69511512a16389eee687deb8abe92'
Auto-merging Gemfile
Auto-merging Gemfile.lock
CONFLICT (content): Merge conflict in Gemfile.lock
```

Then I run `bundle install` from the command line and it works fine.

Does anyone have any suggestions?