Datasets:

Modalities:
Tabular
Text
Formats:
parquet
Size:
< 1K
ArXiv:
DOI:
Libraries:
Datasets
pandas
File size: 7,831 Bytes
d822266
1
{"head_branch": "master", "contributor": "jelmer", "sha_fail": "a36e3c039fb1cd09ddd1729531b1cf9fb99924ab", "sha_success": "cd0990259901351400deda93b529ec601cfa52e8", "language": "Python", "repo_owner": "jelmer", "repo_name": "dulwich", "workflow_name": "Python tests", "workflow_filename": "pythontest.yml", "workflow_path": ".github/workflows/pythontest.yml", "workflow": "name: Python tests\n\non:\n  push:\n  pull_request:\n  schedule:\n    - cron: \"0 6 * * *\" # Daily 6AM UTC build\n\njobs:\n  test:\n    runs-on: ${{ matrix.os }}\n    strategy:\n      matrix:\n        os: [ubuntu-latest, macos-latest, windows-latest]\n        python-version:\n          [\"3.7\", \"3.8\", \"3.9\", \"3.10\", \"3.11\"]\n      fail-fast: false\n\n    steps:\n      - uses: actions/checkout@v3\n      - name: Set up Python ${{ matrix.python-version }}\n        uses: actions/setup-python@v4\n        with:\n          python-version: ${{ matrix.python-version }}\n      - name: Install native dependencies (Ubuntu)\n        run: sudo apt-get update && sudo apt-get install -y libgpgme-dev libgpg-error-dev\n        if: \"matrix.os == 'ubuntu-latest'\"\n      - name: Install native dependencies (MacOS)\n        run: brew install swig gpgme\n        if: \"matrix.os == 'macos-latest'\"\n      - name: Install dependencies\n        run: |\n          python -m pip install --upgrade pip\n          pip install --upgrade \".[fastimport,paramiko,https]\"\n      - name: Install gpg on supported platforms\n        run: pip install --upgrade \".[pgp]\"\n        if: \"matrix.os != 'windows-latest' && matrix.python-version != 'pypy3'\"\n      - name: Style checks\n        run: |\n          pip install --upgrade flake8\n          python -m flake8\n      - name: Typing checks\n        run: |\n          pip install --upgrade mypy types-paramiko types-requests\n          python -m mypy dulwich\n        if: \"matrix.python-version != 'pypy3'\"\n      - name: Build\n        run: |\n          python setup.py build_ext -i\n      - name: codespell\n        run: |\n          pip install --upgrade codespell\n          codespell --config .codespellrc .\n      - name: Coverage test suite run\n        run: |\n          pip install --upgrade coverage\n          python -m coverage run -p -m unittest dulwich.tests.test_suite\n", "logs": "  DeprecationWarning)\n....................................ss.s............................................................counting objects: 2, done.\ncopying pack entries: 0/2\ncopying pack entries: 1/2\ncopied 1 pack entries\ngenerating index: 0/2\ngenerating index: 1/2\n127.0.0.1 - - [04/Oct/2023 06:12:31] \"GET /info/refs?service=git-upload-pack HTTP/1.1\" 200 285\n127.0.0.1 - - [04/Oct/2023 06:12:33] \"POST /git-upload-pack HTTP/1.1\" 200 253\n.Push to http://localhost:50010 successful.\nRef refs/heads/master updated\n127.0.0.1 - - [04/Oct/2023 06:12:36] \"GET /info/refs?service=git-receive-pack HTTP/1.1\" 200 195\n127.0.0.1 - - [04/Oct/2023 06:12:38] \"POST /git-receive-pack HTTP/1.1\" 200 52\n..............................ss...........................................................................................s.........................................................s............................................ss....................s..ssss.............................................................................x..................................................s......................................................x..E.......s..s...ss........................ssssssssssssssssssssssssssss.....ssssssssssssssssssssssssssssssssssssssssssssssssssssssss.....sssssssssssssssssssssssssssssssssssssssss\n======================================================================\nERROR: test_incremental_fetch_pack (dulwich.tests.compat.test_client.DulwichTCPClientTest)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n  File \"D:\\a\\dulwich\\dulwich\\dulwich\\protocol.py\", line 213, in read_pkt_line\n    sizestr = read(4)\n  File \"C:\\hostedtoolcache\\windows\\Python\\3.7.9\\x64\\lib\\socket.py\", line 589, in readinto\n    return self._sock.recv_into(b)\nConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n  File \"D:\\a\\dulwich\\dulwich\\dulwich\\tests\\compat\\test_client.py\", line 279, in test_incremental_fetch_pack\n    self.test_fetch_pack()\n  File \"D:\\a\\dulwich\\dulwich\\dulwich\\tests\\compat\\test_client.py\", line 227, in test_fetch_pack\n    result = c.fetch(self._build_path(\"/server_new.export\"), dest)\n  File \"D:\\a\\dulwich\\dulwich\\dulwich\\client.py\", line 822, in fetch\n    depth=depth,\n  File \"D:\\a\\dulwich\\dulwich\\dulwich\\client.py\", line 1169, in fetch_pack\n    progress,\n  File \"D:\\a\\dulwich\\dulwich\\dulwich\\client.py\", line 606, in _handle_upload_pack_tail\n    for chan, data in _read_side_band64k_data(proto.read_pkt_seq()):\n  File \"D:\\a\\dulwich\\dulwich\\dulwich\\client.py\", line 497, in _read_side_band64k_data\n    for pkt in pkt_seq:\n  File \"D:\\a\\dulwich\\dulwich\\dulwich\\protocol.py\", line 275, in read_pkt_seq\n    pkt = self.read_pkt_line()\n  File \"D:\\a\\dulwich\\dulwich\\dulwich\\protocol.py\", line 225, in read_pkt_line\n    raise HangupException() from exc\ndulwich.errors.HangupException: The remote server unexpectedly closed the connection.\n\n----------------------------------------------------------------------\nRan 1503 tests in 200.654s\n\nFAILED (errors=1, skipped=151, expected failures=2)\n##[error]Process completed with exit code 1.\n", "diff": "diff --git a/dulwich/config.py b/dulwich/config.py\nindex 1a32cba7..2bd10877 100644\n--- a/dulwich/config.py\n+++ b/dulwich/config.py\n@@ -780,9 +780,15 @@ def parse_submodules(config: ConfigFile) -> Iterator[Tuple[bytes, bytes, bytes]]\n     for section in config.keys():\n         section_kind, section_name = section\n         if section_kind == b\"submodule\":\n-            sm_path = config.get(section, b\"path\")\n-            sm_url = config.get(section, b\"url\")\n-            yield (sm_path, sm_url, section_name)\n+            try:\n+                sm_path = config.get(section, b\"path\")\n+                sm_url = config.get(section, b\"url\")\n+                yield (sm_path, sm_url, section_name)\n+            except KeyError:\n+                # If either path or url is missing, just ignore this\n+                # submodule entry and move on to the next one. This is\n+                # how git itself handles malformed .gitmodule entries.\n+                pass\n \n \n def iter_instead_of(config: Config, push: bool = False) -> Iterable[Tuple[str, str]]:\ndiff --git a/dulwich/tests/test_config.py b/dulwich/tests/test_config.py\nindex bae048eb..a0504779 100644\n--- a/dulwich/tests/test_config.py\n+++ b/dulwich/tests/test_config.py\n@@ -423,6 +423,31 @@ class SubmodulesTests(TestCase):\n [submodule \"core/lib\"]\n \\tpath = core/lib\n \\turl = https://github.com/phhusson/QuasselC.git\n+\"\"\"\n+            )\n+        )\n+        got = list(parse_submodules(cf))\n+        self.assertEqual(\n+            [\n+                (\n+                    b\"core/lib\",\n+                    b\"https://github.com/phhusson/QuasselC.git\",\n+                    b\"core/lib\",\n+                )\n+            ],\n+            got,\n+        )\n+\n+    def testMalformedSubmodules(self):\n+        cf = ConfigFile.from_file(\n+            BytesIO(\n+                b\"\"\"\\\n+[submodule \"core/lib\"]\n+\\tpath = core/lib\n+\\turl = https://github.com/phhusson/QuasselC.git\n+\n+[submodule \"dulwich\"]\n+\\turl = https://github.com/jelmer/dulwich\n \"\"\"\n             )\n         )\n"}