Skip to content

fetch from in memory remotes without fetch refspec #1261

@nvloff

Description

@nvloff

The docs for git_remote_create_inmemory state:
@fetch the fetch refspec to use for this remote. May be NULL for defaults.

Downloading from in memory remote does nothing with NULL as the fetch refspec. The only call that I managed to properly use on this remote was git_remote_ls.

I'm not sure if this is a bug or missing documentation.

Here is a test that fails, callcount is 0:

void test_network_fetchlocal__inmemory_complete(void)
{
        git_repository *repo;
        git_remote *origin;
        int callcount = 0; 

        const char *url = cl_git_fixture_url("testrepo.git");

        cl_set_cleanup(&cleanup_local_repo, "foo");
        cl_git_pass(git_repository_init(&repo, "foo", true));

        cl_git_pass(git_remote_create_inmemory(&origin, repo, NULL, url));
        cl_git_pass(git_remote_connect(origin, GIT_DIRECTION_FETCH));
        cl_git_pass(git_remote_download(origin, transfer_cb, &callcount));

        cl_assert(callcount > 0);

        git_remote_free(origin);
        git_repository_free(repo);
}

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