project: clean up error message

Superproject update failures on single-manifest checkouts had an extra
space.

Bug: b/254523816
Change-Id: I6f71e42337e324a6975c5d6bba487f83abaf054f
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/357056
Tested-by: LaMont Jones <lamontjones@google.com>
Reviewed-by: Xin Li <delphij@google.com>
diff --git a/project.py b/project.py
index 996fc02..3ccfd14 100644
--- a/project.py
+++ b/project.py
@@ -3932,12 +3932,14 @@
     if git_superproject.UseSuperproject(use_superproject, self.manifest):
       sync_result = self.manifest.superproject.Sync(git_event_log)
       if not sync_result.success:
-        print('warning: git update of superproject for '
-              f'{self.manifest.path_prefix} failed, repo sync will not use '
-              'superproject to fetch source; while this error is not fatal, '
-              'and you can continue to run repo sync, please run repo init '
-              'with the --no-use-superproject option to stop seeing this '
-              'warning', file=sys.stderr)
+        submanifest = ''
+        if self.manifest.path_prefix:
+          submanifest = f'for {self.manifest.path_prefix} '
+        print(f'warning: git update of superproject {submanifest}failed, repo '
+              'sync will not use superproject to fetch source; while this '
+              'error is not fatal, and you can continue to run repo sync, '
+              'please run repo init with the --no-use-superproject option to '
+              'stop seeing this warning', file=sys.stderr)
         if sync_result.fatal and use_superproject is not None:
           return False