Uploaded image for project: 'Sourcetree For Mac'
  1. Sourcetree For Mac
  2. SRCTREE-1607

Deleting submodule with '.' in the path breaks .gitmodules

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: High High
    • 1.6
    • 1.6.0.1
    • None
    • None

      Steps to reproduce

      1. Create a submodule in SourceTree with '.' in the path eg:
        [submodule "test.submodule"]
                path = test.submodule
                url = http://kahloun.foong@localhost:7990/scm/tst/stash.git
        
      2. Right click on the submodule name in SourceTree and select 'delete'
      3. An error will occur (refer to screenshot) and the .gitmodule file is corrupted:
                path = test.submodule
                url = http://kahloun.foong@localhost:7990/scm/tst/stash.git
        [submodule "tes"]
        submodule}.url=(null)
        submodule}.path=(null)
        

      This happen to SourceTree for Windows 0.9.2.2 too

            [SRCTREE-1607] Deleting submodule with '.' in the path breaks .gitmodules

            Fixed, switched to regex instead of simple split to avoid.

            Steve Streeting (Inactive) added a comment - Fixed, switched to regex instead of simple split to avoid.

            raising the priority

            Foong (Inactive) added a comment - raising the priority

            magebarf added a comment -

            Can also add that due to the broken .gitmodules file, all git tools fail so you won't see what files are modified any longer (besides any differences that was already in place before the .gitmodule was "broken").

            This includes the change done to the .gitmodules file itself, and thus you will not be able to revert the changes to it.

            A "quick fix" is to delete the .gitmodules file, and after that discard the changes to it and the submodules which will be marked as deleted.

            magebarf added a comment - Can also add that due to the broken .gitmodules file, all git tools fail so you won't see what files are modified any longer (besides any differences that was already in place before the .gitmodule was "broken"). This includes the change done to the .gitmodules file itself, and thus you will not be able to revert the changes to it. A "quick fix" is to delete the .gitmodules file, and after that discard the changes to it and the submodules which will be marked as deleted.

              Unassigned Unassigned
              klfoong Foong (Inactive)
              Affected customers:
              0 This affects my team
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: