Skip to content

pull on cloned repo throws exception #1235

@mtrachli0616144

Description

@mtrachli0616144

Hello,

I started using this library a couple of weeks ago and I am running into some issues.

I manage to clone the remote directory using the example from the doc. After wards, I perform various checkouts on remote branches in order to retrieve information useful for my app.
After a while, I would like to make a pull on the remote in order to make the local version up to date, again i use the example from the doc:

using (var repo = new Repository(@tmpRepoFolder))
{
PullOptions options = new PullOptions();
options.FetchOptions = new FetchOptions();
options.FetchOptions.CredentialsProvider = new CredentialsHandler(
(url, usernameFromUrl, types) =>
new UsernamePasswordCredentials()
{
Username = myUser,
Password = myPwd
});

            repo.Network.Pull(
                new Signature(myUsr, mail, new DateTimeOffset(DateTime.Now)),
                options);

}
The previous code throws an exception when executing the Pull with the following message:
{"There is no tracking information for the current branch."}

I looked for a bit inside the code and did some debugging. The issue seems to be that the Head property on the repo does not point to any branch(repo.Head.name = "no branch")

I noticed that this happens after the first call to checkout repo.checkout(branchName).

I am not sure this is actually a bug, but I am sure stuck for now. Can you please tell me what i am doing wrong here ?

Thanks

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