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.
Commit
43eeab7c5264cf92b7ca3f3372de025e9e156b0e
Parent
36cb9ec4760495b…
1 file changed
+1
-1
+1
-1
| --- src/checkout.c | ||
| +++ src/checkout.c | ||
| @@ -302,11 +302,11 @@ | ||
| 302 | 302 | db_name("localdb")) |
| 303 | 303 | && db_exists("SELECT 1 FROM %s.stash", db_name("localdb")) |
| 304 | 304 | ){ |
| 305 | 305 | fossil_fatal("closing the checkout will delete your stash"); |
| 306 | 306 | } |
| 307 | - { | |
| 307 | + if( db_is_writeable("repository") ){ | |
| 308 | 308 | char * zUnset = mprintf("ckout:%q", g.zLocalRoot); |
| 309 | 309 | db_unset(zUnset, 1); |
| 310 | 310 | fossil_free(zUnset); |
| 311 | 311 | } |
| 312 | 312 | unlink_local_database(1); |
| 313 | 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 | { |
| 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 |