Fossil SCM

Correct repository option handling so that specifying a directory name does not cause errors when TH1 hooks are enabled.

mistachkin 2014-08-01 06:13 trunk
Commit 36c4551e7cda231c0b5fe99600afc75c10eba2c7
1 file changed +3
+3
--- src/db.c
+++ src/db.c
@@ -1069,10 +1069,13 @@
10691069
**
10701070
** Error out if the repository cannot be opened.
10711071
*/
10721072
void db_find_and_open_repository(int bFlags, int nArgUsed){
10731073
const char *zRep = find_repository_option();
1074
+ if( zRep && file_isdir(zRep)==1 ){
1075
+ goto rep_not_found;
1076
+ }
10741077
if( zRep==0 && nArgUsed && g.argc==nArgUsed+1 ){
10751078
zRep = g.argv[nArgUsed];
10761079
}
10771080
if( zRep==0 ){
10781081
if( db_open_local(0)==0 ){
10791082
--- src/db.c
+++ src/db.c
@@ -1069,10 +1069,13 @@
1069 **
1070 ** Error out if the repository cannot be opened.
1071 */
1072 void db_find_and_open_repository(int bFlags, int nArgUsed){
1073 const char *zRep = find_repository_option();
 
 
 
1074 if( zRep==0 && nArgUsed && g.argc==nArgUsed+1 ){
1075 zRep = g.argv[nArgUsed];
1076 }
1077 if( zRep==0 ){
1078 if( db_open_local(0)==0 ){
1079
--- src/db.c
+++ src/db.c
@@ -1069,10 +1069,13 @@
1069 **
1070 ** Error out if the repository cannot be opened.
1071 */
1072 void db_find_and_open_repository(int bFlags, int nArgUsed){
1073 const char *zRep = find_repository_option();
1074 if( zRep && file_isdir(zRep)==1 ){
1075 goto rep_not_found;
1076 }
1077 if( zRep==0 && nArgUsed && g.argc==nArgUsed+1 ){
1078 zRep = g.argv[nArgUsed];
1079 }
1080 if( zRep==0 ){
1081 if( db_open_local(0)==0 ){
1082

Keyboard Shortcuts

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