static void
send_commits (CcnetProcessor *processor, const char *head)
{
    SeafileSendcommitV3Proc *proc = (SeafileSendcommitV3Proc *)processor;
    USE_PRIV;
    char *last_uploaded;

    last_uploaded = seaf_repo_manager_get_repo_property (seaf->repo_mgr,
                                                         proc->tx_task->repo_id,
                                                         REPO_LOCAL_HEAD);
    if (!last_uploaded || strlen(last_uploaded) != 40) {
        seaf_warning ("Last uploaded commit id is not found in db or invalid.\n");
        ccnet_processor_send_update (processor, SC_SHUTDOWN, SS_SHUTDOWN, NULL, 0);
        ccnet_processor_done (processor, FALSE);
        return;
    }
    memcpy (priv->last_uploaded_id, last_uploaded, 40);
    g_free (last_uploaded);

    ccnet_processor_thread_create (processor,
                                   seaf->job_mgr,
                                   compute_upload_commits_thread,
                                   compute_upload_commits_done,
                                   processor);
}
Beispiel #2
0
static void
set_download_head_info (TransferTask *task)
{
    /* If the last download was interrupted in the fetch and checkout stage,
     * resume last download.
     */
    char *last_head = seaf_repo_manager_get_repo_property (seaf->repo_mgr,
                                                           task->repo_id,
                                                           REPO_PROP_DOWNLOAD_HEAD);
    if (last_head && strcmp (last_head, EMPTY_SHA1) != 0)
        memcpy (task->head, last_head, 41);
    g_free (last_head);
}