Differences From:
File
src/add.c
part of check-in
[2ecc407d9b]
- The "extra" and "clean" commands ignore the repository file if the
repository happens to be within the check-out. Ticket c7b35be88.
by
drh on
2008-07-23 13:01:23.
[view]
To:
File
src/add.c
part of check-in
[141c31792b]
- Do not allow the current repository to be added to the set of files
for a repository. Ticket 8e9136e8.
by
drh on
2008-07-23 17:36:39.
[view]
@@ -39,15 +39,19 @@
*/
void add_cmd(void){
int i;
int vid;
+ Blob repo;
db_must_be_within_tree();
vid = db_lget_int("checkout",0);
if( vid==0 ){
fossil_panic("no checkout to add to");
}
db_begin_transaction();
+ if( !file_tree_name(g.zRepositoryName, &repo, 0) ){
+ blob_zero(&repo);
+ }
for(i=2; i<g.argc; i++){
char *zName;
char *zPath;
Blob pathname;
@@ -66,8 +70,9 @@
zPath = blob_str(&pathname);
if( strcmp(zPath, "manifest")==0
|| strcmp(zPath, "_FOSSIL_")==0
|| strcmp(zPath, "manifest.uuid")==0
+ || blob_compare(&pathname, &repo)==0
){
fossil_warning("cannot add %s", zPath);
}else{
if( !file_is_simple_pathname(zPath) ){