mercurial/cmdutil.py
changeset 41628 ed046348675c
parent 41627 f92844cb942c
child 41649 799e156785f7
--- a/mercurial/cmdutil.py	Thu Feb 07 09:52:22 2019 -0800
+++ b/mercurial/cmdutil.py	Thu Feb 07 09:59:27 2019 -0800
@@ -2059,10 +2059,11 @@
         sub = wctx.sub(subpath)
         try:
             submatch = matchmod.subdirmatcher(subpath, match)
+            subprefix = repo.wvfs.reljoin(prefix, subpath)
             if opts.get(r'subrepos'):
-                bad.extend(sub.add(ui, submatch, prefix, False, **opts))
+                bad.extend(sub.add(ui, submatch, subprefix, False, **opts))
             else:
-                bad.extend(sub.add(ui, submatch, prefix, True, **opts))
+                bad.extend(sub.add(ui, submatch, subprefix, True, **opts))
         except error.LookupError:
             ui.status(_("skipping missing subrepository: %s\n")
                            % join(subpath))