lg2 merge exit code incorrect
- Dominant language
- Perl
- Stars
- 3.9k
- Forks
- 213
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
When testing a simple sh script I noticed a very frustrating error. The same script behaves differently when there is a merge conflict. Namely, when you see this output:
```
Received 0/0 objects in 0bytes
Error: repository is in unexpected state:
repository is in state 1
It looks like a merge is in progress. Either
resolve the conflicts (see `lg2 status`), `lg
2 add` each changed file and commit the resul
t, or run `lg2 reset --hard HEAD` to stop the
merge.
```
In this case, status code 0 is apparently returned, since my if statement prints "succ". However, if I run the same file in a folder without a repo, it prints "fail".
Here is the aforementioned script:
```sh
#! /bin/sh
echo hey
if ! ( git pull ); then
echo fail
else
echo succ
fi
```
Hopefully there can be a small patch, but if not or if I'm doing something wrong, let me know and I'll understand!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.