Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NBug] The path is not of a legal form. #6789

Closed
wapadam opened this issue Jun 12, 2019 · 4 comments
Closed

[NBug] The path is not of a legal form. #6789

wapadam opened this issue Jun 12, 2019 · 4 comments
Labels

Comments

@wapadam
Copy link

wapadam commented Jun 12, 2019

⚠️ The sections below must be filled in and this text must be removed or the issue will be closed.

Current behaviour

Expected behaviour

Steps to reproduce

Error Details

System.ArgumentException: The path is not of a legal form.
   at System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.InternalGetDirectoryName(String path)
   at GitCommands.Submodules.SubmoduleStatusProvider.GetSuperProjectRepositorySubmodulesStructure(GitModule currentModule, SubmoduleInfoResult result, String noBranchText)
   at GitCommands.Submodules.SubmoduleStatusProvider.<>c__DisplayClass16_0.<<UpdateSubmodulesStructure>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at GitUI.ThreadHelper.<>c__DisplayClass13_0.<<FileAndForget>b__0>d.MoveNext()

Environment

  • Git Extensions 3.1.1.6049
  • Build 2f87210
  • Git 2.21.0.windows.1
  • Microsoft Windows NT 10.0.18362.0
  • .NET Framework 4.8.3801.0
  • DPI 96dpi (no scaling)
@archivarius-bot archivarius-bot bot added the ❓ status: incorrectly filled template Issue template is incorrectly filled label Jun 12, 2019
@archivarius-bot
Copy link

Thank you for the bug report 👍

Sadly, it appears some important information is still missing, which you may have overlooked while submitting the bug.
Without this information we may not be able to assist you in resolving the issue.

Please review your submission, fill the missing information in and post a new comment to ping us back to re-open the issue.
Thanks again

@duplicates-detector-bot
Copy link

Potential duplicates:

  • #6599
  • #6654
  • #6744
  • #6755
  • #6765

@gerhardol
Copy link
Member

Duplicate of #6599

@gerhardol gerhardol marked this as a duplicate of #6599 Jun 12, 2019
@gerhardol
Copy link
Member

All set to a duplicate of this seem to get the exception here:
https://github.com/gitextensions/gitextensions/blob/master/GitCommands/Submodules/SubmoduleStatusProvider.cs#L198

So it seems like the submodule path is invalid in some situations.
Something like the following should prevent it:

            if (isCurrentTopProject)
            {
                string path = result.Module.WorkingDir;
                if (Directory.Exists(path))
                {
                    string name = Path.GetFileName(Path.GetDirectoryName(path)) + GetBranchNameSuffix(path, noBranchText);
                    result.TopProject = new SubmoduleInfo { Text = name, Path = path, Bold = true };
                }

                return;
            }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants