Fossil SCM
Reverted a check for the repository size being an even multiple of 512 bytes as a test for validity. Introduced in [/info/bd7f2727ba25912e | an omnibus commit] for obscure reasons, it causes some valid clone operations to fail, as originally reported [forum:/forumpost/16880a28aad1a868 | on the forum].
Commit
4a2d0e78781c9a1056d60a86cce607373cdaca68240c0ab14ee207ed6e35ab10
Parent
369d7d1a20d5f83…
1 file changed
+1
-5
M
src/db.c
+1
-5
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2179,24 +2179,20 @@ | ||
| 2179 | 2179 | /* |
| 2180 | 2180 | ** Open the repository database given by zDbName. If zDbName==NULL then |
| 2181 | 2181 | ** get the name from the already open local database. |
| 2182 | 2182 | */ |
| 2183 | 2183 | void db_open_repository(const char *zDbName){ |
| 2184 | - i64 sz; | |
| 2185 | 2184 | if( g.repositoryOpen ) return; |
| 2186 | 2185 | if( zDbName==0 ){ |
| 2187 | 2186 | if( g.localOpen ){ |
| 2188 | 2187 | zDbName = db_repository_filename(); |
| 2189 | 2188 | } |
| 2190 | 2189 | if( zDbName==0 ){ |
| 2191 | 2190 | db_err("unable to find the name of a repository database"); |
| 2192 | 2191 | } |
| 2193 | 2192 | } |
| 2194 | - if( file_access(zDbName, R_OK) | |
| 2195 | - || (sz = file_size(zDbName, ExtFILE))<16384 | |
| 2196 | - || (sz&0x1ff)!=0 | |
| 2197 | - ){ | |
| 2193 | + if( file_access(zDbName, R_OK) || file_size(zDbName, ExtFILE)<1024 ){ | |
| 2198 | 2194 | if( file_access(zDbName, F_OK) ){ |
| 2199 | 2195 | #ifdef FOSSIL_ENABLE_JSON |
| 2200 | 2196 | g.json.resultCode = FSL_JSON_E_DB_NOT_FOUND; |
| 2201 | 2197 | #endif |
| 2202 | 2198 | fossil_fatal("repository does not exist or" |
| 2203 | 2199 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2179,24 +2179,20 @@ | |
| 2179 | /* |
| 2180 | ** Open the repository database given by zDbName. If zDbName==NULL then |
| 2181 | ** get the name from the already open local database. |
| 2182 | */ |
| 2183 | void db_open_repository(const char *zDbName){ |
| 2184 | i64 sz; |
| 2185 | if( g.repositoryOpen ) return; |
| 2186 | if( zDbName==0 ){ |
| 2187 | if( g.localOpen ){ |
| 2188 | zDbName = db_repository_filename(); |
| 2189 | } |
| 2190 | if( zDbName==0 ){ |
| 2191 | db_err("unable to find the name of a repository database"); |
| 2192 | } |
| 2193 | } |
| 2194 | if( file_access(zDbName, R_OK) |
| 2195 | || (sz = file_size(zDbName, ExtFILE))<16384 |
| 2196 | || (sz&0x1ff)!=0 |
| 2197 | ){ |
| 2198 | if( file_access(zDbName, F_OK) ){ |
| 2199 | #ifdef FOSSIL_ENABLE_JSON |
| 2200 | g.json.resultCode = FSL_JSON_E_DB_NOT_FOUND; |
| 2201 | #endif |
| 2202 | fossil_fatal("repository does not exist or" |
| 2203 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2179,24 +2179,20 @@ | |
| 2179 | /* |
| 2180 | ** Open the repository database given by zDbName. If zDbName==NULL then |
| 2181 | ** get the name from the already open local database. |
| 2182 | */ |
| 2183 | void db_open_repository(const char *zDbName){ |
| 2184 | if( g.repositoryOpen ) return; |
| 2185 | if( zDbName==0 ){ |
| 2186 | if( g.localOpen ){ |
| 2187 | zDbName = db_repository_filename(); |
| 2188 | } |
| 2189 | if( zDbName==0 ){ |
| 2190 | db_err("unable to find the name of a repository database"); |
| 2191 | } |
| 2192 | } |
| 2193 | if( file_access(zDbName, R_OK) || file_size(zDbName, ExtFILE)<1024 ){ |
| 2194 | if( file_access(zDbName, F_OK) ){ |
| 2195 | #ifdef FOSSIL_ENABLE_JSON |
| 2196 | g.json.resultCode = FSL_JSON_E_DB_NOT_FOUND; |
| 2197 | #endif |
| 2198 | fossil_fatal("repository does not exist or" |
| 2199 |