FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Error: 1 conflict prevents checkout - when merging clean working directory · Issue #941 · nodegit/nodegit · GitHub

Repository navigation

Error: 1 conflict prevents checkout - when merging clean working directory #941

Description

Hello,
i am trying to pull changes from a Repository. My working directory is clean but i am getting the error stated in the title.

My merge code looks like this:

var mOpts = new NodeGit.MergeOptions();
NodeGit.Merge.initOptions(mOpts, 1);
mOpts.fileFavor = NodeGit.Merge.FILE_FAVOR.THEIRS;
repository.mergeBranches(dbRepo.branch, 'origin/' + dbRepo.branch, signature, NodeGit.Merge.PREFERENCE.FASTFORWARD_ONLY, mOpts);

I'm not sure if this is the right way to use the merge options.

Thanks in advance.

Activity

  1. johnhaley81 commented on Mar 8, 2016

    Collaborator

    @rolatsch Try this:

    return repository.mergeBranches(
      dbRepo.branch,
      'origin/' + dbRepo.branch,
      signature,
      null,
      {
        fileFavor: NodeGit.Merge.FILE_FAVOR.THEIRS
      });
    

    You were doing a FASTFORWARD_ONLY which will supercede the merge option to automatically choose a file. It will stop any and all merges which is what I'm thinking it's doing. So something is on your local that you don't have in your remote.

  2. rolatsch commented on Mar 10, 2016

    Author

    @johnhaley81 Thanks for your reply.
    Unfortunately this still happens. It seems like when i run my code on a newly cloned repository it works once. But when i want to pull again it fails.
    When i run git status in Git Bash i get the following output:

    $ git status
    On branch develop
    Your branch is behind 'origin/develop' by 1 commit, and can be fast-forwarded.
      (use "git pull" to update your local branch)
    nothing to commit, working directory clean
    

    Do i have to do something else after merging to finalize the pulling process?

    UPDATE: it seems like i cant pull with this code two times. After pulling via Git Bash this code is working again.

  3. rolatsch commented on Mar 23, 2016

    Author

    any updates on this? Here is my full pull code

    NodeGit.Repository.open(repoDir)
                .catch(function (error) {
                    console.error(error);
                })
                .then(function (repo) {
                    console.log('fetching changes');
                    process.send({
                        "repository": dbRepo.identifier,
                        "status": "running",
                        "message": "Fetching changes from origin.",
                        "error": false
                    });
    
                    repository = repo;
    
                    return repository.fetchAll({
                        callbacks: {
                            credentials: function () {
                                return userpassPlaintextNew(dbRepo.user, dbRepo.password);
                            },
                            certificateCheck: function () {
                                return 1;
                            }
                        }
                    })
                })
                .then(function (fetches) {
                    console.log('fetches: ' + fetches);
    
                    var signature = NodeGit.Signature.now("TableauDeploymentTool", "ab@c.de");
    
                    return repository.mergeBranches(
                        dbRepo.branch,
                        'origin/' + dbRepo.branch,
                        signature,
                        null,
                        {
                            fileFavor: NodeGit.Merge.FILE_FAVOR.THEIRS
                        });
                })
                .catch(function (error) {
                    console.error(error);
                });
    
  4. johnhaley81 commented on Mar 24, 2016

    Collaborator

    @rolatsch What's dbRepo.branch?

  5. rolatsch commented on Mar 24, 2016

    Author

    @johnhaley81 dbRepo is an object which holds the information about my repository.
    The branch property is just the branch name. For example master or development.

  6. johnhaley81 commented on Apr 8, 2016

    Collaborator

    @rolatsch #971 might fix this issue. Could you try that out when you get a moment please?

  7. rolatsch commented on Apr 26, 2016

    Author

    @johnhaley81 sorry it took me a while to give this a try.
    With the latest revision of nodegit an no changes to my code this issue still persists.

    Is it worth trying to clone the repository with nodegit instead of pulling a repository which was cloned via the git command line?

  8. rolatsch commented on Jul 11, 2016

    Author

    Did a rewrite of my code and now it's working somehow. My old code used a subprocess to work on the repository. Maybe this caused a conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL