Skip to content

show conflict filenames in error message when git.pull() #331

Open
@cwtuan

Description

@cwtuan

When I use git cmd to pull from remote branch git pull origin b1, the error message shows the conflict detail such as conflict filenames.

From gitlab.alibaba-inc.com:g1/p1
 * branch            b1         -> FETCH_HEAD
Auto-merging src/routes/index.js
CONFLICT (content): Merge conflict in src/routes/index.js
Auto-merging src/core/intl.js
Auto-merging README.md
Automatic merge failed; fix conflicts and then commit the result.

But When I use simple-git to pull from remote branch git.pull('origin', 'b1'), the error message isn't clear. Is possible to show the conflict filenames as in git cmd.

Error: From http://gitlab.xxxx.com/xxx/my-project2
 * branch            b1         -> FETCH_HEAD

    at /tmp/publish/node_modules/[email protected]@simple-git/promise.js:21:26
    at Git.<anonymous> (/tmp/publish/node_modules/[email protected]@simple-git/src/git.js:1553:13)
    at Function.Git.fail (/tmp/publish/node_modules/[email protected]@simple-git/src/git.js:1478:18)
    at fail (/tmp/publish/node_modules/[email protected]@simple-git/src/git.js:1436:20)
    at /tmp/publish/node_modules/[email protected]@simple-git/src/git.js:1445:16
    at process._tickCallback (internal/process/next_tick.js:109:7)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions