Fossil SCM

Do not allow "fossil open URL" without a --workdir option to work on a non-empty directory.

drh 2020-08-08 17:29 trunk
Commit f0805380f7b4ddb7e040069a1a43cc4aa37e897e28e18134ec9c0a95b9af550b
1 file changed +3
+3
--- src/db.c
+++ src/db.c
@@ -3175,10 +3175,13 @@
31753175
}
31763176
}
31773177
if( file_chdir(zWorkDir, 0) ){
31783178
fossil_fatal("unable to make %s the working directory", zWorkDir);
31793179
}
3180
+ }else if( keepFlag==0 && isUri && file_directory_size(".", 0, 1)>0 ){
3181
+ fossil_fatal("directory %s is not empty\nuse \"--workdir .\" "
3182
+ "to override this error", zPwd);
31803183
}
31813184
31823185
if( db_open_local_v2(0, allowNested) ){
31833186
fossil_fatal("there is already an open tree at %s", g.zLocalRoot);
31843187
}
31853188
--- src/db.c
+++ src/db.c
@@ -3175,10 +3175,13 @@
3175 }
3176 }
3177 if( file_chdir(zWorkDir, 0) ){
3178 fossil_fatal("unable to make %s the working directory", zWorkDir);
3179 }
 
 
 
3180 }
3181
3182 if( db_open_local_v2(0, allowNested) ){
3183 fossil_fatal("there is already an open tree at %s", g.zLocalRoot);
3184 }
3185
--- src/db.c
+++ src/db.c
@@ -3175,10 +3175,13 @@
3175 }
3176 }
3177 if( file_chdir(zWorkDir, 0) ){
3178 fossil_fatal("unable to make %s the working directory", zWorkDir);
3179 }
3180 }else if( keepFlag==0 && isUri && file_directory_size(".", 0, 1)>0 ){
3181 fossil_fatal("directory %s is not empty\nuse \"--workdir .\" "
3182 "to override this error", zPwd);
3183 }
3184
3185 if( db_open_local_v2(0, allowNested) ){
3186 fossil_fatal("there is already an open tree at %s", g.zLocalRoot);
3187 }
3188

Keyboard Shortcuts

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