Fossil SCM
Ensure that "fossil info arg" not occurring in a check-out does not try to access a repository that does not exist. [forum:/forumpost/6ddeec566b|forum post 6ddeec566b].
Commit
c6a0e669f8e8b3e2ef0272eb838d7ec551bd7b302fb6d36e4659224c61387772
Parent
3e87f78e6019f2e…
1 file changed
+3
-1
+3
-1
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -257,17 +257,19 @@ | ||
| 257 | 257 | } |
| 258 | 258 | fossil_print("fossil: %z\n", file_fullexename(g.nameOfExe)); |
| 259 | 259 | fossil_print("version: %s", z); |
| 260 | 260 | blob_reset(&vx); |
| 261 | 261 | } |
| 262 | - }else{ | |
| 262 | + }else if( g.repositoryOpen ){ | |
| 263 | 263 | int rid; |
| 264 | 264 | rid = name_to_rid(g.argv[2]); |
| 265 | 265 | if( rid==0 ){ |
| 266 | 266 | fossil_fatal("no such object: %s", g.argv[2]); |
| 267 | 267 | } |
| 268 | 268 | show_common_info(rid, "hash:", 1, 1); |
| 269 | + }else{ | |
| 270 | + fossil_fatal("Coult not find or open a Fossil repository"); | |
| 269 | 271 | } |
| 270 | 272 | } |
| 271 | 273 | |
| 272 | 274 | /* |
| 273 | 275 | ** Show the context graph (immediate parents and children) for |
| 274 | 276 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -257,17 +257,19 @@ | |
| 257 | } |
| 258 | fossil_print("fossil: %z\n", file_fullexename(g.nameOfExe)); |
| 259 | fossil_print("version: %s", z); |
| 260 | blob_reset(&vx); |
| 261 | } |
| 262 | }else{ |
| 263 | int rid; |
| 264 | rid = name_to_rid(g.argv[2]); |
| 265 | if( rid==0 ){ |
| 266 | fossil_fatal("no such object: %s", g.argv[2]); |
| 267 | } |
| 268 | show_common_info(rid, "hash:", 1, 1); |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | /* |
| 273 | ** Show the context graph (immediate parents and children) for |
| 274 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -257,17 +257,19 @@ | |
| 257 | } |
| 258 | fossil_print("fossil: %z\n", file_fullexename(g.nameOfExe)); |
| 259 | fossil_print("version: %s", z); |
| 260 | blob_reset(&vx); |
| 261 | } |
| 262 | }else if( g.repositoryOpen ){ |
| 263 | int rid; |
| 264 | rid = name_to_rid(g.argv[2]); |
| 265 | if( rid==0 ){ |
| 266 | fossil_fatal("no such object: %s", g.argv[2]); |
| 267 | } |
| 268 | show_common_info(rid, "hash:", 1, 1); |
| 269 | }else{ |
| 270 | fossil_fatal("Coult not find or open a Fossil repository"); |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | /* |
| 275 | ** Show the context graph (immediate parents and children) for |
| 276 |