[[[
Fix issue #3620: svn add ^/ triggers assertion failure

* subversion/svn/add-cmd.c:
  (svn_cl__add): Raise an error if a target argument isn't a working
  copy path before calling svn_client_add4(), which would trigger an
  assertion.

Found by: stsp
Patch by: Uwe Stuehler (subversion-li...@bsdx.de)
]]]


Index: subversion/svn/add-cmd.c
===================================================================
--- subversion/svn/add-cmd.c	(revision 937011)
+++ subversion/svn/add-cmd.c	(working copy)
@@ -31,9 +31,11 @@
 
 #include "svn_client.h"
 #include "svn_error.h"
+#include "svn_path.h"
 #include "svn_pools.h"
 #include "cl.h"
 
+#include "svn_private_config.h"
 
 
 /*** Code. ***/
@@ -71,6 +73,12 @@
     {
       const char *target = APR_ARRAY_IDX(targets, i, const char *);
 
+      if (svn_path_is_url(target))
+        return svn_error_createf(SVN_ERR_WC_NOT_FILE,
+                                 NULL,
+                                 _("Path '%s' is not a working copy path"),
+                                 target);
+
       svn_pool_clear(subpool);
       SVN_ERR(svn_cl__check_cancel(ctx->cancel_baton));
       SVN_ERR(svn_cl__try

Reply via email to