subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1134302 - in /subversion/trunk/subversion: libsvn_subr/dirent_uri.c tests/libsvn_subr/dirent_uri-test.c
Date Fri, 10 Jun 2011 13:02:55 GMT
Author: julianfoad
Date: Fri Jun 10 13:02:55 2011
New Revision: 1134302

URL: http://svn.apache.org/viewvc?rev=1134302&view=rev
Log:
Remove redundant code.

* subversion/libsvn_subr/dirent_uri.c
  (svn_uri_skip_ancestor): Remove the checks for the parent URL length being
    zero, as the assertions guarantee it contains at least a schema.

* subversion/tests/libsvn_subr/dirent_uri-test.c
  (test_relpath_skip_ancestor): Remove duplicate test cases.

Modified:
    subversion/trunk/subversion/libsvn_subr/dirent_uri.c
    subversion/trunk/subversion/tests/libsvn_subr/dirent_uri-test.c

Modified: subversion/trunk/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/dirent_uri.c?rev=1134302&r1=1134301&r2=1134302&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/trunk/subversion/libsvn_subr/dirent_uri.c Fri Jun 10 13:02:55 2011
@@ -1527,10 +1527,7 @@ svn_uri_skip_ancestor(const char *parent
   if (child_uri[len] == 0)
     return ""; /* parent_uri == child_uri */
 
-  if (len == 1 && child_uri[0] == '/')
-    return child_uri + 1;
-
-  if (len > 0 && child_uri[len] == '/')
+  if (child_uri[len] == '/')
     return child_uri + len + 1;
 
   return child_uri;

Modified: subversion/trunk/subversion/tests/libsvn_subr/dirent_uri-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/dirent_uri-test.c?rev=1134302&r1=1134301&r2=1134302&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/dirent_uri-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/dirent_uri-test.c Fri Jun 10 13:02:55 2011
@@ -1532,12 +1532,9 @@ test_relpath_skip_ancestor(apr_pool_t *p
     { "foo",             "foot",           "foot"},
     { "foot",            "foo",            "foo"},
     { "",                "foo",            "foo"},
-    { "",                "foo",            "foo"},
-    { "",                "foo",            "foo"},
     { "foo/bar/bla",     "foo/bar",        "foo/bar"},
     { "foo/bar",         "foo/bar/bla",    "bla"},
     { "foo/bar",         "foo",            "foo"},
-    { "foo/bar",         "foo",            "foo"},
     { "",                "bar/bla",        "bar/bla"},
     { "http:/server",    "http:/server/q", "q" },
     { "svn:/server",     "http:/server/q", "http:/server/q" },



Mime
View raw message