We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Conditionally do git submodule operations
We shouldn't be doing submodule operations on repositories that don't have submodules. We can check for this by determining if a repository has a `.gitmodules` file at the top level, and if not, we can skip these commands.

Raised in #3520 as we're storing all these as extraneous commands now.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `readthedocs/vcs_support/backends/git.py`
Content:
```
1 """Git-related utilities."""
2 
3 from __future__ import absolute_import
4 
5 import csv
6 import logging
7 import os
8 import re
9 
10 from builtins import str
11 from six import StringIO
12 
13 from readthedocs.projects.exceptions import RepositoryError
14 from readthedocs.vcs_support.base import BaseVCS, VCSVersion
15 
16 
17 log = logging.getLogger(__name__)
18 
19 
20 class Backend(BaseVCS):
21 
22     """Git VCS backend."""
23 
24     supports_tags = True
25     supports_branches = True
26     fallback_branch = 'master'  # default branch
27 
28     def __init__(self, *args, **kwargs):
29         super(Backend, self).__init__(*args, **kwargs)
30         self.token = kwargs.get('token', None)
31         self.repo_url = self._get_clone_url()
32 
33     def _get_clone_url(self):
34         if '://' in self.repo_url:
35             hacked_url = self.repo_url.split('://')[1]
36             hacked_url = re.sub('.git$', '', hacked_url)
37             clone_url = 'https://%s' % hacked_url
38             if self.token:
39                 clone_url = 'https://%s@%s' % (self.token, hacked_url)
40                 return clone_url
41             # Don't edit URL because all hosts aren't the same
42 
43             # else:
44                 # clone_url = 'git://%s' % (hacked_url)
45         return self.repo_url
46 
47     def set_remote_url(self, url):
48         return self.run('git', 'remote', 'set-url', 'origin', url)
49 
50     def update(self):
51         # Use checkout() to update repo
52         self.checkout()
53 
54     def repo_exists(self):
55         code, _, _ = self.run('git', 'status', record=False)
56         return code == 0
57 
58     def fetch(self):
59         code, _, _ = self.run('git', 'fetch', '--tags', '--prune')
60         if code != 0:
61             raise RepositoryError
62 
63     def checkout_revision(self, revision=None):
64         if not revision:
65             branch = self.default_branch or self.fallback_branch
66             revision = 'origin/%s' % branch
67 
68         code, out, err = self.run(
69             'git', 'checkout', '--force', revision)
70         if code != 0:
71             log.warning("Failed to checkout revision '%s': %s",
72                         revision, code)
73         return [code, out, err]
74 
75     def clone(self):
76         code, _, _ = self.run(
77             'git', 'clone', '--recursive', self.repo_url, '.')
78         if code != 0:
79             raise RepositoryError
80 
81     @property
82     def tags(self):
83         retcode, stdout, _ = self.run('git', 'show-ref', '--tags', record_as_success=True)
84         # error (or no tags found)
85         if retcode != 0:
86             return []
87         return self.parse_tags(stdout)
88 
89     def parse_tags(self, data):
90         """
91         Parses output of show-ref --tags, eg:
92 
93             3b32886c8d3cb815df3793b3937b2e91d0fb00f1 refs/tags/2.0.0
94             bd533a768ff661991a689d3758fcfe72f455435d refs/tags/2.0.1
95             c0288a17899b2c6818f74e3a90b77e2a1779f96a refs/tags/2.0.2
96             a63a2de628a3ce89034b7d1a5ca5e8159534eef0 refs/tags/2.1.0.beta2
97             c7fc3d16ed9dc0b19f0d27583ca661a64562d21e refs/tags/2.1.0.rc1
98             edc0a2d02a0cc8eae8b67a3a275f65cd126c05b1 refs/tags/2.1.0.rc2
99 
100         Into VCSTag objects with the tag name as verbose_name and the commit
101         hash as identifier.
102         """
103         # parse the lines into a list of tuples (commit-hash, tag ref name)
104         # StringIO below is expecting Unicode data, so ensure that it gets it.
105         if not isinstance(data, str):
106             data = str(data)
107         raw_tags = csv.reader(StringIO(data), delimiter=' ')
108         vcs_tags = []
109         for row in raw_tags:
110             row = [f for f in row if f != '']
111             if row == []:
112                 continue
113             commit_hash, name = row
114             clean_name = name.replace('refs/tags/', '')
115             vcs_tags.append(VCSVersion(self, commit_hash, clean_name))
116         return vcs_tags
117 
118     @property
119     def branches(self):
120         # Only show remote branches
121         retcode, stdout, _ = self.run('git', 'branch', '-r')
122         # error (or no tags found)
123         if retcode != 0:
124             return []
125         return self.parse_branches(stdout)
126 
127     def parse_branches(self, data):
128         """
129         Parse output of git branch -r
130 
131         e.g.:
132 
133               origin/2.0.X
134               origin/HEAD -> origin/master
135               origin/develop
136               origin/master
137               origin/release/2.0.0
138               origin/release/2.1.0
139         """
140         clean_branches = []
141         # StringIO below is expecting Unicode data, so ensure that it gets it.
142         if not isinstance(data, str):
143             data = str(data)
144         raw_branches = csv.reader(StringIO(data), delimiter=' ')
145         for branch in raw_branches:
146             branch = [f for f in branch if f != '' and f != '*']
147             # Handle empty branches
148             if branch:
149                 branch = branch[0]
150                 if branch.startswith('origin/'):
151                     verbose_name = branch.replace('origin/', '')
152                     if verbose_name in ['HEAD']:
153                         continue
154                     clean_branches.append(VCSVersion(self, branch, verbose_name))
155                 else:
156                     clean_branches.append(VCSVersion(self, branch, branch))
157         return clean_branches
158 
159     @property
160     def commit(self):
161         _, stdout, _ = self.run('git', 'rev-parse', 'HEAD')
162         return stdout.strip()
163 
164     def checkout(self, identifier=None):
165         self.check_working_dir()
166 
167         # Clone or update repository
168         if self.repo_exists():
169             self.set_remote_url(self.repo_url)
170             self.fetch()
171         else:
172             self.make_clean_working_dir()
173             self.clone()
174 
175         # Find proper identifier
176         if not identifier:
177             identifier = self.default_branch or self.fallback_branch
178 
179         identifier = self.find_ref(identifier)
180 
181         # Checkout the correct identifier for this branch.
182         code, out, err = self.checkout_revision(identifier)
183         if code != 0:
184             return code, out, err
185 
186         # Clean any remains of previous checkouts
187         self.run('git', 'clean', '-d', '-f', '-f')
188 
189         # Update submodules
190         self.run('git', 'submodule', 'sync')
191         self.run('git', 'submodule', 'update',
192                  '--init', '--recursive', '--force')
193 
194         return code, out, err
195 
196     def find_ref(self, ref):
197         # Check if ref starts with 'origin/'
198         if ref.startswith('origin/'):
199             return ref
200 
201         # Check if ref is a branch of the origin remote
202         if self.ref_exists('remotes/origin/' + ref):
203             return 'origin/' + ref
204 
205         return ref
206 
207     def ref_exists(self, ref):
208         code, _, _ = self.run('git', 'show-ref', ref, record_as_success=True)
209         return code == 0
210 
211     @property
212     def env(self):
213         env = super(Backend, self).env
214         env['GIT_DIR'] = os.path.join(self.working_dir, '.git')
215         # Don't prompt for username, this requires Git 2.3+
216         env['GIT_TERMINAL_PROMPT'] = '0'
217         return env
218
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/readthedocs/vcs_support/backends/git.py b/readthedocs/vcs_support/backends/git.py
--- a/readthedocs/vcs_support/backends/git.py
+++ b/readthedocs/vcs_support/backends/git.py
@@ -55,6 +55,10 @@
         code, _, _ = self.run('git', 'status', record=False)
         return code == 0
 
+    def submodules_exists(self):
+        code, out, _ = self.run('git', 'submodule', 'status', record=False)
+        return code == 0 and bool(out)
+
     def fetch(self):
         code, _, _ = self.run('git', 'fetch', '--tags', '--prune')
         if code != 0:
@@ -187,9 +191,10 @@
         self.run('git', 'clean', '-d', '-f', '-f')
 
         # Update submodules
-        self.run('git', 'submodule', 'sync')
-        self.run('git', 'submodule', 'update',
-                 '--init', '--recursive', '--force')
+        if self.submodules_exists():
+            self.run('git', 'submodule', 'sync')
+            self.run('git', 'submodule', 'update',
+                     '--init', '--recursive', '--force')
 
         return code, out, err

{"golden_diff": "diff --git a/readthedocs/vcs_support/backends/git.py b/readthedocs/vcs_support/backends/git.py\n--- a/readthedocs/vcs_support/backends/git.py\n+++ b/readthedocs/vcs_support/backends/git.py\n@@ -55,6 +55,10 @@\n         code, _, _ = self.run('git', 'status', record=False)\n         return code == 0\n \n+    def submodules_exists(self):\n+        code, out, _ = self.run('git', 'submodule', 'status', record=False)\n+        return code == 0 and bool(out)\n+\n     def fetch(self):\n         code, _, _ = self.run('git', 'fetch', '--tags', '--prune')\n         if code != 0:\n@@ -187,9 +191,10 @@\n         self.run('git', 'clean', '-d', '-f', '-f')\n \n         # Update submodules\n-        self.run('git', 'submodule', 'sync')\n-        self.run('git', 'submodule', 'update',\n-                 '--init', '--recursive', '--force')\n+        if self.submodules_exists():\n+            self.run('git', 'submodule', 'sync')\n+            self.run('git', 'submodule', 'update',\n+                     '--init', '--recursive', '--force')\n \n         return code, out, err\n", "issue": "Conditionally do git submodule operations\nWe shouldn't be doing submodule operations on repositories that don't have submodules. We can check for this by determining if a repository has a `.gitmodules` file at the top level, and if not, we can skip these commands.\r\n\r\nRaised in #3520 as we're storing all these as extraneous commands now.\n", "before_files": [{"content": "\"\"\"Git-related utilities.\"\"\"\n\nfrom __future__ import absolute_import\n\nimport csv\nimport logging\nimport os\nimport re\n\nfrom builtins import str\nfrom six import StringIO\n\nfrom readthedocs.projects.exceptions import RepositoryError\nfrom readthedocs.vcs_support.base import BaseVCS, VCSVersion\n\n\nlog = logging.getLogger(__name__)\n\n\nclass Backend(BaseVCS):\n\n    \"\"\"Git VCS backend.\"\"\"\n\n    supports_tags = True\n    supports_branches = True\n    fallback_branch = 'master'  # default branch\n\n    def __init__(self, *args, **kwargs):\n        super(Backend, self).__init__(*args, **kwargs)\n        self.token = kwargs.get('token', None)\n        self.repo_url = self._get_clone_url()\n\n    def _get_clone_url(self):\n        if '://' in self.repo_url:\n            hacked_url = self.repo_url.split('://')[1]\n            hacked_url = re.sub('.git$', '', hacked_url)\n            clone_url = 'https://%s' % hacked_url\n            if self.token:\n                clone_url = 'https://%s@%s' % (self.token, hacked_url)\n                return clone_url\n            # Don't edit URL because all hosts aren't the same\n\n            # else:\n                # clone_url = 'git://%s' % (hacked_url)\n        return self.repo_url\n\n    def set_remote_url(self, url):\n        return self.run('git', 'remote', 'set-url', 'origin', url)\n\n    def update(self):\n        # Use checkout() to update repo\n        self.checkout()\n\n    def repo_exists(self):\n        code, _, _ = self.run('git', 'status', record=False)\n        return code == 0\n\n    def fetch(self):\n        code, _, _ = self.run('git', 'fetch', '--tags', '--prune')\n        if code != 0:\n            raise RepositoryError\n\n    def checkout_revision(self, revision=None):\n        if not revision:\n            branch = self.default_branch or self.fallback_branch\n            revision = 'origin/%s' % branch\n\n        code, out, err = self.run(\n            'git', 'checkout', '--force', revision)\n        if code != 0:\n            log.warning(\"Failed to checkout revision '%s': %s\",\n                        revision, code)\n        return [code, out, err]\n\n    def clone(self):\n        code, _, _ = self.run(\n            'git', 'clone', '--recursive', self.repo_url, '.')\n        if code != 0:\n            raise RepositoryError\n\n    @property\n    def tags(self):\n        retcode, stdout, _ = self.run('git', 'show-ref', '--tags', record_as_success=True)\n        # error (or no tags found)\n        if retcode != 0:\n            return []\n        return self.parse_tags(stdout)\n\n    def parse_tags(self, data):\n        \"\"\"\n        Parses output of show-ref --tags, eg:\n\n            3b32886c8d3cb815df3793b3937b2e91d0fb00f1 refs/tags/2.0.0\n            bd533a768ff661991a689d3758fcfe72f455435d refs/tags/2.0.1\n            c0288a17899b2c6818f74e3a90b77e2a1779f96a refs/tags/2.0.2\n            a63a2de628a3ce89034b7d1a5ca5e8159534eef0 refs/tags/2.1.0.beta2\n            c7fc3d16ed9dc0b19f0d27583ca661a64562d21e refs/tags/2.1.0.rc1\n            edc0a2d02a0cc8eae8b67a3a275f65cd126c05b1 refs/tags/2.1.0.rc2\n\n        Into VCSTag objects with the tag name as verbose_name and the commit\n        hash as identifier.\n        \"\"\"\n        # parse the lines into a list of tuples (commit-hash, tag ref name)\n        # StringIO below is expecting Unicode data, so ensure that it gets it.\n        if not isinstance(data, str):\n            data = str(data)\n        raw_tags = csv.reader(StringIO(data), delimiter=' ')\n        vcs_tags = []\n        for row in raw_tags:\n            row = [f for f in row if f != '']\n            if row == []:\n                continue\n            commit_hash, name = row\n            clean_name = name.replace('refs/tags/', '')\n            vcs_tags.append(VCSVersion(self, commit_hash, clean_name))\n        return vcs_tags\n\n    @property\n    def branches(self):\n        # Only show remote branches\n        retcode, stdout, _ = self.run('git', 'branch', '-r')\n        # error (or no tags found)\n        if retcode != 0:\n            return []\n        return self.parse_branches(stdout)\n\n    def parse_branches(self, data):\n        \"\"\"\n        Parse output of git branch -r\n\n        e.g.:\n\n              origin/2.0.X\n              origin/HEAD -> origin/master\n              origin/develop\n              origin/master\n              origin/release/2.0.0\n              origin/release/2.1.0\n        \"\"\"\n        clean_branches = []\n        # StringIO below is expecting Unicode data, so ensure that it gets it.\n        if not isinstance(data, str):\n            data = str(data)\n        raw_branches = csv.reader(StringIO(data), delimiter=' ')\n        for branch in raw_branches:\n            branch = [f for f in branch if f != '' and f != '*']\n            # Handle empty branches\n            if branch:\n                branch = branch[0]\n                if branch.startswith('origin/'):\n                    verbose_name = branch.replace('origin/', '')\n                    if verbose_name in ['HEAD']:\n                        continue\n                    clean_branches.append(VCSVersion(self, branch, verbose_name))\n                else:\n                    clean_branches.append(VCSVersion(self, branch, branch))\n        return clean_branches\n\n    @property\n    def commit(self):\n        _, stdout, _ = self.run('git', 'rev-parse', 'HEAD')\n        return stdout.strip()\n\n    def checkout(self, identifier=None):\n        self.check_working_dir()\n\n        # Clone or update repository\n        if self.repo_exists():\n            self.set_remote_url(self.repo_url)\n            self.fetch()\n        else:\n            self.make_clean_working_dir()\n            self.clone()\n\n        # Find proper identifier\n        if not identifier:\n            identifier = self.default_branch or self.fallback_branch\n\n        identifier = self.find_ref(identifier)\n\n        # Checkout the correct identifier for this branch.\n        code, out, err = self.checkout_revision(identifier)\n        if code != 0:\n            return code, out, err\n\n        # Clean any remains of previous checkouts\n        self.run('git', 'clean', '-d', '-f', '-f')\n\n        # Update submodules\n        self.run('git', 'submodule', 'sync')\n        self.run('git', 'submodule', 'update',\n                 '--init', '--recursive', '--force')\n\n        return code, out, err\n\n    def find_ref(self, ref):\n        # Check if ref starts with 'origin/'\n        if ref.startswith('origin/'):\n            return ref\n\n        # Check if ref is a branch of the origin remote\n        if self.ref_exists('remotes/origin/' + ref):\n            return 'origin/' + ref\n\n        return ref\n\n    def ref_exists(self, ref):\n        code, _, _ = self.run('git', 'show-ref', ref, record_as_success=True)\n        return code == 0\n\n    @property\n    def env(self):\n        env = super(Backend, self).env\n        env['GIT_DIR'] = os.path.join(self.working_dir, '.git')\n        # Don't prompt for username, this requires Git 2.3+\n        env['GIT_TERMINAL_PROMPT'] = '0'\n        return env\n", "path": "readthedocs/vcs_support/backends/git.py"}], "after_files": [{"content": "\"\"\"Git-related utilities.\"\"\"\n\nfrom __future__ import absolute_import\n\nimport csv\nimport logging\nimport os\nimport re\n\nfrom builtins import str\nfrom six import StringIO\n\nfrom readthedocs.projects.exceptions import RepositoryError\nfrom readthedocs.vcs_support.base import BaseVCS, VCSVersion\n\n\nlog = logging.getLogger(__name__)\n\n\nclass Backend(BaseVCS):\n\n    \"\"\"Git VCS backend.\"\"\"\n\n    supports_tags = True\n    supports_branches = True\n    fallback_branch = 'master'  # default branch\n\n    def __init__(self, *args, **kwargs):\n        super(Backend, self).__init__(*args, **kwargs)\n        self.token = kwargs.get('token', None)\n        self.repo_url = self._get_clone_url()\n\n    def _get_clone_url(self):\n        if '://' in self.repo_url:\n            hacked_url = self.repo_url.split('://')[1]\n            hacked_url = re.sub('.git$', '', hacked_url)\n            clone_url = 'https://%s' % hacked_url\n            if self.token:\n                clone_url = 'https://%s@%s' % (self.token, hacked_url)\n                return clone_url\n            # Don't edit URL because all hosts aren't the same\n\n            # else:\n                # clone_url = 'git://%s' % (hacked_url)\n        return self.repo_url\n\n    def set_remote_url(self, url):\n        return self.run('git', 'remote', 'set-url', 'origin', url)\n\n    def update(self):\n        # Use checkout() to update repo\n        self.checkout()\n\n    def repo_exists(self):\n        code, _, _ = self.run('git', 'status', record=False)\n        return code == 0\n\n    def submodules_exists(self):\n        code, out, _ = self.run('git', 'submodule', 'status', record=False)\n        return code == 0 and bool(out)\n\n    def fetch(self):\n        code, _, _ = self.run('git', 'fetch', '--tags', '--prune')\n        if code != 0:\n            raise RepositoryError\n\n    def checkout_revision(self, revision=None):\n        if not revision:\n            branch = self.default_branch or self.fallback_branch\n            revision = 'origin/%s' % branch\n\n        code, out, err = self.run(\n            'git', 'checkout', '--force', revision)\n        if code != 0:\n            log.warning(\"Failed to checkout revision '%s': %s\",\n                        revision, code)\n        return [code, out, err]\n\n    def clone(self):\n        code, _, _ = self.run(\n            'git', 'clone', '--recursive', self.repo_url, '.')\n        if code != 0:\n            raise RepositoryError\n\n    @property\n    def tags(self):\n        retcode, stdout, _ = self.run('git', 'show-ref', '--tags', record_as_success=True)\n        # error (or no tags found)\n        if retcode != 0:\n            return []\n        return self.parse_tags(stdout)\n\n    def parse_tags(self, data):\n        \"\"\"\n        Parses output of show-ref --tags, eg:\n\n            3b32886c8d3cb815df3793b3937b2e91d0fb00f1 refs/tags/2.0.0\n            bd533a768ff661991a689d3758fcfe72f455435d refs/tags/2.0.1\n            c0288a17899b2c6818f74e3a90b77e2a1779f96a refs/tags/2.0.2\n            a63a2de628a3ce89034b7d1a5ca5e8159534eef0 refs/tags/2.1.0.beta2\n            c7fc3d16ed9dc0b19f0d27583ca661a64562d21e refs/tags/2.1.0.rc1\n            edc0a2d02a0cc8eae8b67a3a275f65cd126c05b1 refs/tags/2.1.0.rc2\n\n        Into VCSTag objects with the tag name as verbose_name and the commit\n        hash as identifier.\n        \"\"\"\n        # parse the lines into a list of tuples (commit-hash, tag ref name)\n        # StringIO below is expecting Unicode data, so ensure that it gets it.\n        if not isinstance(data, str):\n            data = str(data)\n        raw_tags = csv.reader(StringIO(data), delimiter=' ')\n        vcs_tags = []\n        for row in raw_tags:\n            row = [f for f in row if f != '']\n            if row == []:\n                continue\n            commit_hash, name = row\n            clean_name = name.replace('refs/tags/', '')\n            vcs_tags.append(VCSVersion(self, commit_hash, clean_name))\n        return vcs_tags\n\n    @property\n    def branches(self):\n        # Only show remote branches\n        retcode, stdout, _ = self.run('git', 'branch', '-r')\n        # error (or no tags found)\n        if retcode != 0:\n            return []\n        return self.parse_branches(stdout)\n\n    def parse_branches(self, data):\n        \"\"\"\n        Parse output of git branch -r\n\n        e.g.:\n\n              origin/2.0.X\n              origin/HEAD -> origin/master\n              origin/develop\n              origin/master\n              origin/release/2.0.0\n              origin/release/2.1.0\n        \"\"\"\n        clean_branches = []\n        # StringIO below is expecting Unicode data, so ensure that it gets it.\n        if not isinstance(data, str):\n            data = str(data)\n        raw_branches = csv.reader(StringIO(data), delimiter=' ')\n        for branch in raw_branches:\n            branch = [f for f in branch if f != '' and f != '*']\n            # Handle empty branches\n            if branch:\n                branch = branch[0]\n                if branch.startswith('origin/'):\n                    verbose_name = branch.replace('origin/', '')\n                    if verbose_name in ['HEAD']:\n                        continue\n                    clean_branches.append(VCSVersion(self, branch, verbose_name))\n                else:\n                    clean_branches.append(VCSVersion(self, branch, branch))\n        return clean_branches\n\n    @property\n    def commit(self):\n        _, stdout, _ = self.run('git', 'rev-parse', 'HEAD')\n        return stdout.strip()\n\n    def checkout(self, identifier=None):\n        self.check_working_dir()\n\n        # Clone or update repository\n        if self.repo_exists():\n            self.set_remote_url(self.repo_url)\n            self.fetch()\n        else:\n            self.make_clean_working_dir()\n            self.clone()\n\n        # Find proper identifier\n        if not identifier:\n            identifier = self.default_branch or self.fallback_branch\n\n        identifier = self.find_ref(identifier)\n\n        # Checkout the correct identifier for this branch.\n        code, out, err = self.checkout_revision(identifier)\n        if code != 0:\n            return code, out, err\n\n        # Clean any remains of previous checkouts\n        self.run('git', 'clean', '-d', '-f', '-f')\n\n        # Update submodules\n        if self.submodules_exists():\n            self.run('git', 'submodule', 'sync')\n            self.run('git', 'submodule', 'update',\n                     '--init', '--recursive', '--force')\n\n        return code, out, err\n\n    def find_ref(self, ref):\n        # Check if ref starts with 'origin/'\n        if ref.startswith('origin/'):\n            return ref\n\n        # Check if ref is a branch of the origin remote\n        if self.ref_exists('remotes/origin/' + ref):\n            return 'origin/' + ref\n\n        return ref\n\n    def ref_exists(self, ref):\n        code, _, _ = self.run('git', 'show-ref', ref, record_as_success=True)\n        return code == 0\n\n    @property\n    def env(self):\n        env = super(Backend, self).env\n        env['GIT_DIR'] = os.path.join(self.working_dir, '.git')\n        # Don't prompt for username, this requires Git 2.3+\n        env['GIT_TERMINAL_PROMPT'] = '0'\n        return env\n", "path": "readthedocs/vcs_support/backends/git.py"}]}