Repository: streamlit/streamlit

Issue:
"Deploy this app" option in the app's hamburger menu incorrectly fills Community Cloud deployment information
### Checklist

- [X] I have searched the [existing issues](https://github.com/streamlit/streamlit/issues) for similar issues.
- [X] I added a very descriptive title to this issue.
- [X] I have provided sufficient information below to help reproduce this issue.

### Summary

From the app menu in the upper-right corner, there is an option to "Deploy this app" when viewing a local app. This _almost_ works but the Community Cloud deployment page has an extra `.git` in the repo name where it's not needed. This results in an error and the repo is not recognized. Deleting `.git` corrects the format and it becomes deployable.

![image](https://github.com/streamlit/streamlit/assets/135349133/627a76da-820c-4a0c-ab24-ebd456c11f93)


### Reproducible Code Example

_No response_

### Steps To Reproduce

0. Be signed in to GitHub and Community Cloud in your default web browser.
1. View a locally running app (from a git repo, up-to-date with remote).
2. Open the app menu in the upper-right corner.
3. Click "**Deploy this app**"


### Expected Behavior

The deployment page for Community Cloud should open with correctly pre-filled informaiton.

### Current Behavior

The deployment page for Community Cloud does open with mostly correct information, but the repo has a `.git` suffix which is not correct for the field. (Manually deleting the `.git` ending rectifies the error.)

### Is this a regression?

- [ ] Yes, this used to work in a previous version.

### Debug info

- Streamlit version: 1.24.0
- Python version: 3.11
- Operating System: macOS
- Browser: Chrome
- Virtual environment: conda


### Additional Information

_No response_

### Are you willing to submit a PR?

- [ ] Yes, I am willing to submit a PR!


Discussion:
Just had a look: this only happens if you explicitly clone the repo with the ".git" URL. We apparently just use the URL that you use when cloning initially. Should probably remove the .git, so it always works. 

Resolving patch:
diff --git a/e2e/scripts/deploy_button.py b/e2e/scripts/deploy_button.py
--- a/e2e/scripts/deploy_button.py
+++ b/e2e/scripts/deploy_button.py
@@ -12,7 +12,5 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import streamlit as st
-
-# no need to set it using this since we add ?_stcore_testing=true to the url param
-# st.experimental_set_query_params(_stcore_testing="true")
+# Nothing to do here since the deploy button is part of the frontend even
+# without any Streamlit element being rendered.
diff --git a/lib/streamlit/runtime/app_session.py b/lib/streamlit/runtime/app_session.py
--- a/lib/streamlit/runtime/app_session.py
+++ b/lib/streamlit/runtime/app_session.py
@@ -680,6 +680,10 @@ def _handle_git_information_request(self) -> None:
 
             repository_name, branch, module = repo_info
 
+            if repository_name.endswith(".git"):
+                # Remove the .git extension from the repository name
+                repository_name = repository_name[:-4]
+
             msg.git_info_changed.repository = repository_name
             msg.git_info_changed.branch = branch
             msg.git_info_changed.module = module


Test patch:
diff --git a/frontend/app/src/App.test.tsx b/frontend/app/src/App.test.tsx
--- a/frontend/app/src/App.test.tsx
+++ b/frontend/app/src/App.test.tsx
@@ -61,7 +61,6 @@ jest.mock("@streamlit/app/src/connection/ConnectionManager")
 jest.mock("@streamlit/lib/src/baseconsts", () => {
   return {
     ...jest.requireActual("@streamlit/lib/src/baseconsts"),
-    SHOW_DEPLOY_BUTTON: true,
   }
 })