mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-09-01 23:46:53 +00:00
Repo can be set 'read-only' or 'normal' status.
Return 'status' in get_repo(s) apis.
This commit is contained in:
@@ -136,6 +136,15 @@ do_create_virtual_repo (SeafRepoManager *mgr,
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (set_repo_commit_to_db (repo_id, repo_name, 0,
|
||||
repo->version, repo->encrypted, user) < 0) {
|
||||
seaf_warning("Failed to add repo info.\n");
|
||||
g_set_error (error, SEAFILE_DOMAIN, SEAF_ERR_GENERAL,
|
||||
"Failed to add repo info");
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
out:
|
||||
if (repo)
|
||||
seaf_repo_unref (repo);
|
||||
@@ -186,6 +195,14 @@ create_virtual_repo_common (SeafRepoManager *mgr,
|
||||
"Origin library not exists");
|
||||
return NULL;
|
||||
}
|
||||
if (origin_repo->status != REPO_STATUS_NORMAL) {
|
||||
seaf_warning("Status of repo %.8s is %d, can't create VirtualRepo\n",
|
||||
origin_repo_id, origin_repo->status);
|
||||
g_set_error (error, SEAFILE_DOMAIN, SEAF_ERR_GENERAL,
|
||||
"Unnormal repo status");
|
||||
seaf_repo_unref (origin_repo);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (origin_repo->encrypted) {
|
||||
if (origin_repo->enc_version < 2) {
|
||||
|
Reference in New Issue
Block a user