Fossil SCM

Alternative implementation to the improved "remove directory" error message.

drh 2010-02-08 16:10 trunk
Commit 8c9f949a3f3024eb15d11142051c67538c61d03c
1 file changed +4
+4
--- src/add.c
+++ src/add.c
@@ -204,10 +204,14 @@
204204
char *zName;
205205
char *zPath;
206206
Blob pathname;
207207
208208
zName = mprintf("%/", g.argv[i]);
209
+ if( file_isdir(zName) ){
210
+ fossil_fatal("cannot remove directories -"
211
+ " remove individual files instead");
212
+ }
209213
file_tree_name(zName, &pathname, 1);
210214
zPath = blob_str(&pathname);
211215
if( !db_exists(
212216
"SELECT 1 FROM vfile WHERE pathname=%Q AND NOT deleted", zPath) ){
213217
fossil_fatal("not in the repository: %s", zName);
214218
--- src/add.c
+++ src/add.c
@@ -204,10 +204,14 @@
204 char *zName;
205 char *zPath;
206 Blob pathname;
207
208 zName = mprintf("%/", g.argv[i]);
 
 
 
 
209 file_tree_name(zName, &pathname, 1);
210 zPath = blob_str(&pathname);
211 if( !db_exists(
212 "SELECT 1 FROM vfile WHERE pathname=%Q AND NOT deleted", zPath) ){
213 fossil_fatal("not in the repository: %s", zName);
214
--- src/add.c
+++ src/add.c
@@ -204,10 +204,14 @@
204 char *zName;
205 char *zPath;
206 Blob pathname;
207
208 zName = mprintf("%/", g.argv[i]);
209 if( file_isdir(zName) ){
210 fossil_fatal("cannot remove directories -"
211 " remove individual files instead");
212 }
213 file_tree_name(zName, &pathname, 1);
214 zPath = blob_str(&pathname);
215 if( !db_exists(
216 "SELECT 1 FROM vfile WHERE pathname=%Q AND NOT deleted", zPath) ){
217 fossil_fatal("not in the repository: %s", zName);
218

Keyboard Shortcuts

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