Fossil SCM

Now only remove the ckout:... key if the repo db is writeable. May leave orphans in the config db for read-only repos, but it was doing that before, anyway.

stephan 2014-05-30 16:52 UTC close-cleanup-config
Commit 43eeab7c5264cf92b7ca3f3372de025e9e156b0e
1 file changed +1 -1
+1 -1
--- src/checkout.c
+++ src/checkout.c
@@ -302,11 +302,11 @@
302302
db_name("localdb"))
303303
&& db_exists("SELECT 1 FROM %s.stash", db_name("localdb"))
304304
){
305305
fossil_fatal("closing the checkout will delete your stash");
306306
}
307
- {
307
+ if( db_is_writeable("repository") ){
308308
char * zUnset = mprintf("ckout:%q", g.zLocalRoot);
309309
db_unset(zUnset, 1);
310310
fossil_free(zUnset);
311311
}
312312
unlink_local_database(1);
313313
--- src/checkout.c
+++ src/checkout.c
@@ -302,11 +302,11 @@
302 db_name("localdb"))
303 && db_exists("SELECT 1 FROM %s.stash", db_name("localdb"))
304 ){
305 fossil_fatal("closing the checkout will delete your stash");
306 }
307 {
308 char * zUnset = mprintf("ckout:%q", g.zLocalRoot);
309 db_unset(zUnset, 1);
310 fossil_free(zUnset);
311 }
312 unlink_local_database(1);
313
--- src/checkout.c
+++ src/checkout.c
@@ -302,11 +302,11 @@
302 db_name("localdb"))
303 && db_exists("SELECT 1 FROM %s.stash", db_name("localdb"))
304 ){
305 fossil_fatal("closing the checkout will delete your stash");
306 }
307 if( db_is_writeable("repository") ){
308 char * zUnset = mprintf("ckout:%q", g.zLocalRoot);
309 db_unset(zUnset, 1);
310 fossil_free(zUnset);
311 }
312 unlink_local_database(1);
313

Keyboard Shortcuts

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