diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py
index dcbe60783..feaba235b 100644
--- a/lib/bb/tests/fetch.py
+++ b/lib/bb/tests/fetch.py
@@ -900,6 +900,21 @@ class FetcherLocalTest(FetcherTest):
         fetcher = bb.fetch2.Fetch(localpaths.keys(), self.d)
         self.assertEqual(fetcher.localpaths(), list(localpaths.values()))
 
+    def test_git_submodule_localpaths(self):
+        urls = [
+            "gitsm://git.yoctoproject.org/git-submodule-test;protocol=https"
+                ";branch=master;rev=a2885dd7d25380d23627e7544b7bbb55014b16ee"
+        ]
+        filenames = [
+            "git.yoctoproject.org.git-submodule-test"
+        ]
+        fetcher = bb.fetch.Fetch(urls, self.d)
+        localpaths = fetcher.localpaths()
+        self.assertEqual(len(localpaths), len(filenames))
+        for localpath, filename in zip(localpaths, filenames):
+            l = os.path.join(self.dldir, "git2", filename)
+            self.assertEqual(localpath, l)
+
 class FetcherNoNetworkTest(FetcherTest):
     def setUp(self):
         super().setUp()
