Fossil SCM

Print an error message and quite if the --user option appears on a "fossil commit" command but specifies a username not found in the database. Ticket [3ed2e994e1750b]

drh 2011-08-30 18:04 trunk
Commit b120bc8b262ac0056935c0c9365957fe331d29b4
1 file changed +7 -1
+7 -1
--- src/user.c
+++ src/user.c
@@ -312,11 +312,17 @@
312312
*/
313313
void user_select(void){
314314
Stmt s;
315315
316316
if( g.userUid ) return;
317
- if( attempt_user(g.zLogin) ) return;
317
+ if( g.zLogin ){
318
+ if( attempt_user(g.zLogin)==0 ){
319
+ fossil_fatal("no such user: %s", g.zLogin);
320
+ }else{
321
+ return;
322
+ }
323
+ }
318324
319325
if( g.localOpen && attempt_user(db_lget("default-user",0)) ) return;
320326
321327
if( attempt_user(db_get("default-user", 0)) ) return;
322328
323329
--- src/user.c
+++ src/user.c
@@ -312,11 +312,17 @@
312 */
313 void user_select(void){
314 Stmt s;
315
316 if( g.userUid ) return;
317 if( attempt_user(g.zLogin) ) return;
 
 
 
 
 
 
318
319 if( g.localOpen && attempt_user(db_lget("default-user",0)) ) return;
320
321 if( attempt_user(db_get("default-user", 0)) ) return;
322
323
--- src/user.c
+++ src/user.c
@@ -312,11 +312,17 @@
312 */
313 void user_select(void){
314 Stmt s;
315
316 if( g.userUid ) return;
317 if( g.zLogin ){
318 if( attempt_user(g.zLogin)==0 ){
319 fossil_fatal("no such user: %s", g.zLogin);
320 }else{
321 return;
322 }
323 }
324
325 if( g.localOpen && attempt_user(db_lget("default-user",0)) ) return;
326
327 if( attempt_user(db_get("default-user", 0)) ) return;
328
329

Keyboard Shortcuts

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