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].

wyoung 2022-02-28 19:23 trunk
Commit 4a2d0e78781c9a1056d60a86cce607373cdaca68240c0ab14ee207ed6e35ab10
1 file changed +1 -5
+1 -5
--- src/db.c
+++ src/db.c
@@ -2179,24 +2179,20 @@
21792179
/*
21802180
** Open the repository database given by zDbName. If zDbName==NULL then
21812181
** get the name from the already open local database.
21822182
*/
21832183
void db_open_repository(const char *zDbName){
2184
- i64 sz;
21852184
if( g.repositoryOpen ) return;
21862185
if( zDbName==0 ){
21872186
if( g.localOpen ){
21882187
zDbName = db_repository_filename();
21892188
}
21902189
if( zDbName==0 ){
21912190
db_err("unable to find the name of a repository database");
21922191
}
21932192
}
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 ){
21982194
if( file_access(zDbName, F_OK) ){
21992195
#ifdef FOSSIL_ENABLE_JSON
22002196
g.json.resultCode = FSL_JSON_E_DB_NOT_FOUND;
22012197
#endif
22022198
fossil_fatal("repository does not exist or"
22032199
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button