twosigma / twosigma/git-meta

libgit2 breaks when merging a submodule change into a branch where that submodule has been deleted

Open
#435 3 comments 0 reactions 1 assignee Claimed by @novalis View on GitHub
libgit2
Dominant language
JavaScript
Stars
233
Forks
54
PR merge metrics
No merged PRs in 30d

Description

[x.zip](https://github.com/twosigma/git-meta/files/1519629/x.zip)
Using the attached zip or this:
```bash
$ write-repos -o 'a=B:Ca-1;Ba=a|x=U:C3-2 s;C5-4 foo=bar;C4-2 s=Sa:a;Bmaster=3;Bfoo=5'
```
Do the following to reproduce:
```bash
$ cd x
$ git meta merge -m foo foo
Error: object not found - no match for id (64ba9179dc7865187060226f21f4f7642ac783a1)
```

The relevant lines are:

```JavaScript
const mergeIndex = yield SubmoduleUtil.cacheSubmodules(repo, () => {
return NodeGit.Merge.commits(repo, head, commit, null);
});

const checkoutOpts = {
checkoutStrategy: NodeGit.Checkout.STRATEGY.FORCE
};
yield SubmoduleUtil.cacheSubmodules(repo, () => {
return NodeGit.Checkout.index(repo, mergeIndex, checkoutOpts);
});
```

And it is the attempt to checkout the merge index where it dies.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.