diff --git a/dulwich/cli.py b/dulwich/cli.py index 4cc5a09ae..f95b9f261 100755 --- a/dulwich/cli.py +++ b/dulwich/cli.py @@ -329,7 +329,6 @@ def run(self, args): sys.stdout.write(' %s %s\n' % (sha, path)) - class cmd_tag(Command): def run(self, args): parser = optparse.OptionParser() diff --git a/dulwich/porcelain.py b/dulwich/porcelain.py index 9d697e8cb..e79e90df8 100644 --- a/dulwich/porcelain.py +++ b/dulwich/porcelain.py @@ -877,12 +877,12 @@ def submodule_add(repo, url, path=None, name=None): """ with open_repo_closing(repo) as r: if path is None: - path = os.path.relpath(canonical_part(url), repo.path) + path = os.path.relpath(_canonical_part(url), r.path) if name is None: name = path # TODO(jelmer): Move this logic to dulwich.submodule - gitmodules_path = os.path.join(repo.path, ".gitmodules") + gitmodules_path = os.path.join(r.path, ".gitmodules") try: config = ConfigFile.from_path(gitmodules_path) except FileNotFoundError: diff --git a/dulwich/tests/test_porcelain.py b/dulwich/tests/test_porcelain.py index 666a9198b..acd8a6b46 100644 --- a/dulwich/tests/test_porcelain.py +++ b/dulwich/tests/test_porcelain.py @@ -1425,8 +1425,8 @@ def test_add(self): with open('%s/.gitmodules' % self.repo.path, 'r') as f: self.assertEqual("""\ [submodule "bar"] - url = ../bar.git - path = bar +\turl = ../bar.git +\tpath = bar """, f.read())