You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by iv...@apache.org on 2015/12/25 12:23:12 UTC

svn commit: r1721669 - /subversion/trunk/subversion/mod_dav_svn/liveprops.c

Author: ivan
Date: Fri Dec 25 11:23:11 2015
New Revision: 1721669

URL: http://svn.apache.org/viewvc?rev=1721669&view=rev
Log:
Remove unneeded call to svn_fs_check_path() in mod_dav_svn.

* subversion/mod_dav_svn/liveprops.c
  (insert_prop_internal): Do not call to svn_fs_check_path() to check whether
   resource is a file: we already checked this information using
   RESOURCE->COLLECTION flag.

Modified:
    subversion/trunk/subversion/mod_dav_svn/liveprops.c

Modified: subversion/trunk/subversion/mod_dav_svn/liveprops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/liveprops.c?rev=1721669&r1=1721668&r2=1721669&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/liveprops.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/liveprops.c Fri Dec 25 11:23:11 2015
@@ -720,7 +720,6 @@ insert_prop_internal(const dav_resource
               || resource->type == DAV_RESOURCE_TYPE_WORKING
               || resource->type == DAV_RESOURCE_TYPE_VERSION))
         {
-          svn_node_kind_t kind;
           svn_checksum_t *checksum;
           svn_checksum_kind_t checksum_kind;
 
@@ -733,14 +732,20 @@ insert_prop_internal(const dav_resource
               checksum_kind = svn_checksum_sha1;
             }
 
-          serr = svn_fs_check_path(&kind, resource->info->root.root,
-                                   resource->info->repos_path, scratch_pool);
-          if (!serr && kind == svn_node_file)
-            serr = svn_fs_file_checksum(&checksum, checksum_kind,
-                                        resource->info->root.root,
-                                        resource->info->repos_path, TRUE,
-                                        scratch_pool);
-          if (serr != NULL)
+          serr = svn_fs_file_checksum(&checksum, checksum_kind,
+                                      resource->info->root.root,
+                                      resource->info->repos_path, TRUE,
+                                      scratch_pool);
+          if (serr && serr->apr_err == SVN_ERR_FS_NOT_FILE)
+            {
+              /* It should not happen since we're already checked
+                 RESOURCE->COLLECTION, but svn_fs_check_path() call
+                 was added in r1239596 for some reason. Keep it for
+                 now. */
+              svn_error_clear(serr);
+              return DAV_PROP_INSERT_NOTSUPP;
+            }
+          else if (serr)
             {
               ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err,
                             resource->info->r,
@@ -756,9 +761,6 @@ insert_prop_internal(const dav_resource
               break;
             }
 
-          if (kind != svn_node_file)
-            return DAV_PROP_INSERT_NOTSUPP;
-
           value = svn_checksum_to_cstring(checksum, scratch_pool);
 
           if (! value)