Skip to content

Getting changes between remote and local fails if remote branch does not exist #136

Description

@Nils-Kolvenbach

After creating a new Project locally and creating the remote repository, when we then add the remote URL via Version Control settings in Client, the following error appears:

Executed "git log work..origin/work --format=%H|%s|%an|%ae|%aI|%D" in 8ms
Error occurred in handler for 'core:projects:getChanges': GitError: Git 2.43.4 (/home/nils/Development/client/node_modules/dugite/git/libexec/git-core) command "git log work..origin/work --format=%H|%s|%an|%ae|%aI|%D" executed for "/home/nils/elek.io/projects/32ba1a3c-c775-4ff0-b5cd-08c71edfe18b" failed with exit code "128" and message "fatal: ambiguous argument 'work..origin/work': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'"
    at GitService.git (file:///home/nils/Development/client/node_modules/@elek-io/core/dist/node/index.node.js:3325:13)
    at async GitService.log (file:///home/nils/Development/client/node_modules/@elek-io/core/dist/node/index.node.js:3179:20)
    at async ProjectService.getChanges (file:///home/nils/Development/client/node_modules/@elek-io/core/dist/node/index.node.js:3855:20)
    at async file:///home/nils/Development/client/out/main/index.js:272:16
    at async Session.<anonymous> (node:electron/js2c/browser_init:2:107024)

After creating the branch "work" on remote, this error did not show up again. So before executing getChanges we need to check first, if the branch exists in remote. If not, we should create it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions