Uploaded image for project: 'Sourcetree for Windows'
  1. Sourcetree for Windows
  2. SRCTREEWIN-11282

Cannot enter upon force-push if repository has a submodule

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Medium
    • None
    • 3.0.12, 3.0.17
    • None
      • GitHub account (free user, 2-step authenticated)
      • Windows 7 Professional 64bit
      • SourceTree for Windows 3.0.12
      • Git Credential Manager for Windows 1.16.1 (to use 2-step-authed GitHub account on SourceTree)
    • Severity 3 - Minor

    Description

      Steps to reproduce

      1. On GitHub, create two private repositories named "repo1" and "repo2" with "Initialize this repository with a README" enabled
      2. On SourceTree, open new tab and...
        1. Select "Clone" icon
        2. Enter https://github.com/<account>/repo1.git to "Source Path / URL:"
        3. Enter C:\test\repo1 to "Destination Path:"
        4. "Clone" and wait
        5. Click "Remote" icon with a red exclamation mark
        6. "Settings" -> Double-click "origin" line -> "OK" to close remote details -> "OK" to close repository settings
        7. Confirm the exclamation is removed
          • So steps 2-5 ~ 2-7 are just for calming it
      3. Open new tab and do same except its url/path/name is for repo2
      4. On SourceTree repo1 tab, right-click the left panel and select "Add Submodule..."
      5. Enter https://github.com/<account>/repo2.git to "Source Path / URL:" -> "OK"
      6. "Stage All" and commit with "Push changes immediately to origin/master" enabled
      7. On local repo1 directory, create "textA.txt"
      8. On SourceTree repo1 tab, "Stage All" and commit with "Push changes immediately to origin/master" enabled
      9. Right-click on the second commit (the one when added submodule) and select "Reset current branch to this commit" -> select "Hard" -> "Yes" and confirm "textA.txt" is removed from local repo1
      10. On local repo1 directory, create "textB.txt"
      11. On SourceTree repo1 tab, "Stage All" and just commit without "Push changes immediately to origin/master" enabled
        • Now the master shows "1↑ 1↓" state
      12. Select "Push" icon to show push screen
      13. "Push" master
      14. Confirm Sourcetree shows error, of cause, then close
      15. Push again with "Force Push" enabled
        • No matter if "Use Safe Force Push" is enabled in SourceTree preference

      Expected behavior

      • Succeed force-push, or get another error at least

      Actual behavior

      • Sourcetree shows "Submodule Check" dialog for a split second and returns to push screen (step 12) automatically at once

      Handy solution (for users)

      1. Just push without "Force Push" checked and confirm the error appears
      2. Copy the first line (Git command) from the error and close
      3. "Cancel" to close push screen
      4. Select "Terminal" icon
      5. Paste the command on terminal, insert "-f" option manually and press enter key
        • My case:
          git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks -c credential.helper= -c credential.helper="C:/Users/<user>/AppData/Local/ATLASS~1/SOURCE~1/GIT_EX~1/GIT-CR~1.EXE" push -f -v origin master:master
      1. Wait to confirm success and close terminal

      Attachments

        Activity

          People

            Unassigned Unassigned
            9af9e1c2cccd 森の子リスのミーコの大冒険
            Votes:
            10 Vote for this issue
            Watchers:
            13 Start watching this issue

            Dates

              Created:
              Updated: