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

drh 2025-03-11 00:01 trunk
Commit c6a0e669f8e8b3e2ef0272eb838d7ec551bd7b302fb6d36e4659224c61387772
1 file changed +3 -1
+3 -1
--- src/info.c
+++ src/info.c
@@ -257,17 +257,19 @@
257257
}
258258
fossil_print("fossil: %z\n", file_fullexename(g.nameOfExe));
259259
fossil_print("version: %s", z);
260260
blob_reset(&vx);
261261
}
262
- }else{
262
+ }else if( g.repositoryOpen ){
263263
int rid;
264264
rid = name_to_rid(g.argv[2]);
265265
if( rid==0 ){
266266
fossil_fatal("no such object: %s", g.argv[2]);
267267
}
268268
show_common_info(rid, "hash:", 1, 1);
269
+ }else{
270
+ fossil_fatal("Coult not find or open a Fossil repository");
269271
}
270272
}
271273
272274
/*
273275
** Show the context graph (immediate parents and children) for
274276
--- 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

Keyboard Shortcuts

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