Diff
Not logged in

Differences From:

File src/file.c part of check-in [525cc35bf3] - Allow the check-in of files show names begin with ".". Add the "private" table to repository schema but do not yet do anything with it. by drh on 2008-05-17 08:53:34. [view]

To:

File src/file.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]

@@ -318,21 +318,24 @@
 
 /*
 ** Compute a pathname for a file relative to the root of the local
 ** tree.  Return TRUE on success.  On failure, print and error
-** message and quit.
+** message and quit if the errFatal flag is true.  If errFatal is
+** false, then simply return 0.
 **
 ** The root of the tree is defined by the g.zLocalRoot variable.
 */
-int file_tree_name(const char *zOrigName, Blob *pOut){
+int file_tree_name(const char *zOrigName, Blob *pOut, int errFatal){
   int n;
   Blob full;
   db_must_be_within_tree();
   file_canonical_name(zOrigName, &full);
   n = strlen(g.zLocalRoot);
   if( blob_size(&full)<=n || memcmp(g.zLocalRoot, blob_buffer(&full), n) ){
     blob_reset(&full);
-    fossil_fatal("file outside of checkout tree: %s", zOrigName);
+    if( errFatal ){
+      fossil_fatal("file outside of checkout tree: %s", zOrigName);
+    }
     return 0;
   }
   blob_zero(pOut);
   blob_append(pOut, blob_buffer(&full)+n, blob_size(&full)-n);
@@ -348,9 +351,9 @@
   int i;
   Blob x;
   blob_zero(&x);
   for(i=2; i<g.argc; i++){
-    if( file_tree_name(g.argv[i], &x) ){
+    if( file_tree_name(g.argv[i], &x, 1) ){
       printf("%s\n", blob_buffer(&x));
       blob_reset(&x);
     }
   }