We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
scm_track: Push script not working
### Describe the bug

After the refactoring of 

### Steps to reproduce

1. Enable `scm_track` 
2. Perform any change action in Cobbler
3. See error in logs

Note: The error with pathspec is already fixed on `main` through #3021.

### Expected behavior

Cobbler can push the commits to the specified remote.

### Cobbler version

<!--- Paste output from `cobbler version` -->
````paste below
cobbler:~ # cobbler version
Cobbler 3.3.3
  source: ?, ?
  build time: Thu Dec 19 12:00:00 2019
````

### Operating system

SLES 15 SP5

### Cobbler log

<!--- Paste (partial) output from `/var/log/cobbler/cobbler.log` -->
````paste below
[Thread-20] 2024-02-12T16:03:34 - DEBUG | running python triggers from /var/lib/cobbler/triggers/change/*
[Thread-20] 2024-02-12T16:03:34 - DEBUG | running python trigger cobbler.modules.scm_track
[Thread-20] 2024-02-12T16:03:34 - INFO | running: ['git', 'add', '--all', 'collections']
[Thread-20] 2024-02-12T16:03:34 - INFO | received on stdout: 
[Thread-20] 2024-02-12T16:03:34 - DEBUG | received on stderr: 
[Thread-20] 2024-02-12T16:03:34 - INFO | running: ['git', 'add', '--all', 'templates']
[Thread-20] 2024-02-12T16:03:34 - INFO | received on stdout: 
[Thread-20] 2024-02-12T16:03:34 - DEBUG | received on stderr: 
[Thread-20] 2024-02-12T16:03:34 - INFO | running: ['git', 'add', '--all', 'snippets']
[Thread-20] 2024-02-12T16:03:34 - INFO | received on stdout: 
[Thread-20] 2024-02-12T16:03:34 - DEBUG | received on stderr: 
[Thread-20] 2024-02-12T16:03:34 - INFO | running: ['git', 'commit', '-m', 'API', 'update', '--author', 'Cobbler <cobbler-scm-track@cobbler.arch.nue2.suse.org>']
[Thread-20] 2024-02-12T16:03:34 - INFO | received on stdout: 
[Thread-20] 2024-02-12T16:03:34 - DEBUG | received on stderr: error: pathspec 'update' did not match any file(s) known to git
````

### Screenshots

None

### Additional information

Snippet for from the settings:

```yaml
scm_track_enabled: true
scm_track_mode: "git"
scm_track_author: "Cobbler <cobbler-scm-track@cobbler.arch.nue2.suse.org>"
# scm_push_script: "git push"
scm_push_script: ""
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `cobbler/modules/scm_track.py`
Content:
```
1 """
2 Cobbler Trigger Module that puts the content of the Cobbler data directory under version control. Depending on
3 ``scm_track_mode`` in the settings, this can either be git or Mercurial.
4 """
5 
6 # SPDX-License-Identifier: GPL-2.0-or-later
7 # SPDX-FileCopyrightText: Copyright 2009, Red Hat Inc.
8 # SPDX-FileCopyrightText: Michael DeHaan <michael.dehaan AT gmail>
9 
10 
11 import os
12 from typing import TYPE_CHECKING, Any
13 
14 from cobbler import utils
15 from cobbler.cexceptions import CX
16 
17 if TYPE_CHECKING:
18     from cobbler.api import CobblerAPI
19 
20 
21 def register() -> str:
22     """
23     This pure python trigger acts as if it were a legacy shell-trigger, but is much faster. The return of this method
24     indicates the trigger type
25     :return: Always: ``/var/lib/cobbler/triggers/change/*``
26     """
27 
28     return "/var/lib/cobbler/triggers/change/*"
29 
30 
31 def run(api: "CobblerAPI", args: Any):
32     """
33     Runs the trigger, meaning in this case track any changed which happen to a config or data file.
34 
35     :param api: The api instance of the Cobbler server. Used to look up if scm_track_enabled is true.
36     :param args: The parameter is currently unused for this trigger.
37     :return: 0 on success, otherwise an exception is risen.
38     """
39     settings = api.settings()
40 
41     if not settings.scm_track_enabled:
42         # feature disabled
43         return 0
44 
45     mode = str(settings.scm_track_mode).lower()
46     author = str(settings.scm_track_author)
47     push_script = str(settings.scm_push_script)
48 
49     if mode == "git":
50         old_dir = os.getcwd()
51         os.chdir("/var/lib/cobbler")
52         if os.getcwd() != "/var/lib/cobbler":
53             raise CX("danger will robinson")
54 
55         if not os.path.exists("/var/lib/cobbler/.git"):
56             utils.subprocess_call(["git", "init"], shell=False)
57 
58         # FIXME: If we know the remote user of an XMLRPC call use them as the author
59         utils.subprocess_call(["git", "add", "--all", "collections"], shell=False)
60         utils.subprocess_call(["git", "add", "--all", "templates"], shell=False)
61         utils.subprocess_call(["git", "add", "--all", "snippets"], shell=False)
62         utils.subprocess_call(
63             ["git", "commit", "-m", "API update", "--author", author], shell=False
64         )
65 
66         if push_script:
67             utils.subprocess_call([push_script], shell=False)
68 
69         os.chdir(old_dir)
70         return 0
71 
72     if mode == "hg":
73         # use mercurial
74         old_dir = os.getcwd()
75         os.chdir("/var/lib/cobbler")
76         if os.getcwd() != "/var/lib/cobbler":
77             raise CX("danger will robinson")
78 
79         if not os.path.exists("/var/lib/cobbler/.hg"):
80             utils.subprocess_call(["hg", "init"], shell=False)
81 
82         # FIXME: If we know the remote user of an XMLRPC call use them as the user
83         utils.subprocess_call(["hg", "add collections"], shell=False)
84         utils.subprocess_call(["hg", "add templates"], shell=False)
85         utils.subprocess_call(["hg", "add snippets"], shell=False)
86         utils.subprocess_call(
87             ["hg", "commit", "-m", "API", "update", "--user", author], shell=False
88         )
89 
90         if push_script:
91             utils.subprocess_call([push_script], shell=False)
92 
93         os.chdir(old_dir)
94         return 0
95 
96     raise CX(f"currently unsupported SCM type: {mode}")
97
```
--- 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/cobbler/modules/scm_track.py b/cobbler/modules/scm_track.py
--- a/cobbler/modules/scm_track.py
+++ b/cobbler/modules/scm_track.py
@@ -64,7 +64,7 @@
         )
 
         if push_script:
-            utils.subprocess_call([push_script], shell=False)
+            utils.subprocess_call(push_script.split(" "), shell=False)
 
         os.chdir(old_dir)
         return 0
@@ -84,11 +84,11 @@
         utils.subprocess_call(["hg", "add templates"], shell=False)
         utils.subprocess_call(["hg", "add snippets"], shell=False)
         utils.subprocess_call(
-            ["hg", "commit", "-m", "API", "update", "--user", author], shell=False
+            ["hg", "commit", "-m", "API update", "--user", author], shell=False
         )
 
         if push_script:
-            utils.subprocess_call([push_script], shell=False)
+            utils.subprocess_call(push_script.split(" "), shell=False)
 
         os.chdir(old_dir)
         return 0

{"golden_diff": "diff --git a/cobbler/modules/scm_track.py b/cobbler/modules/scm_track.py\n--- a/cobbler/modules/scm_track.py\n+++ b/cobbler/modules/scm_track.py\n@@ -64,7 +64,7 @@\n         )\n \n         if push_script:\n-            utils.subprocess_call([push_script], shell=False)\n+            utils.subprocess_call(push_script.split(\" \"), shell=False)\n \n         os.chdir(old_dir)\n         return 0\n@@ -84,11 +84,11 @@\n         utils.subprocess_call([\"hg\", \"add templates\"], shell=False)\n         utils.subprocess_call([\"hg\", \"add snippets\"], shell=False)\n         utils.subprocess_call(\n-            [\"hg\", \"commit\", \"-m\", \"API\", \"update\", \"--user\", author], shell=False\n+            [\"hg\", \"commit\", \"-m\", \"API update\", \"--user\", author], shell=False\n         )\n \n         if push_script:\n-            utils.subprocess_call([push_script], shell=False)\n+            utils.subprocess_call(push_script.split(\" \"), shell=False)\n \n         os.chdir(old_dir)\n         return 0\n", "issue": "scm_track: Push script not working\n### Describe the bug\r\n\r\nAfter the refactoring of \r\n\r\n### Steps to reproduce\r\n\r\n1. Enable `scm_track` \r\n2. Perform any change action in Cobbler\r\n3. See error in logs\r\n\r\nNote: The error with pathspec is already fixed on `main` through #3021.\r\n\r\n### Expected behavior\r\n\r\nCobbler can push the commits to the specified remote.\r\n\r\n### Cobbler version\r\n\r\n<!--- Paste output from `cobbler version` -->\r\n````paste below\r\ncobbler:~ # cobbler version\r\nCobbler 3.3.3\r\n  source: ?, ?\r\n  build time: Thu Dec 19 12:00:00 2019\r\n````\r\n\r\n### Operating system\r\n\r\nSLES 15 SP5\r\n\r\n### Cobbler log\r\n\r\n<!--- Paste (partial) output from `/var/log/cobbler/cobbler.log` -->\r\n````paste below\r\n[Thread-20] 2024-02-12T16:03:34 - DEBUG | running python triggers from /var/lib/cobbler/triggers/change/*\r\n[Thread-20] 2024-02-12T16:03:34 - DEBUG | running python trigger cobbler.modules.scm_track\r\n[Thread-20] 2024-02-12T16:03:34 - INFO | running: ['git', 'add', '--all', 'collections']\r\n[Thread-20] 2024-02-12T16:03:34 - INFO | received on stdout: \r\n[Thread-20] 2024-02-12T16:03:34 - DEBUG | received on stderr: \r\n[Thread-20] 2024-02-12T16:03:34 - INFO | running: ['git', 'add', '--all', 'templates']\r\n[Thread-20] 2024-02-12T16:03:34 - INFO | received on stdout: \r\n[Thread-20] 2024-02-12T16:03:34 - DEBUG | received on stderr: \r\n[Thread-20] 2024-02-12T16:03:34 - INFO | running: ['git', 'add', '--all', 'snippets']\r\n[Thread-20] 2024-02-12T16:03:34 - INFO | received on stdout: \r\n[Thread-20] 2024-02-12T16:03:34 - DEBUG | received on stderr: \r\n[Thread-20] 2024-02-12T16:03:34 - INFO | running: ['git', 'commit', '-m', 'API', 'update', '--author', 'Cobbler <cobbler-scm-track@cobbler.arch.nue2.suse.org>']\r\n[Thread-20] 2024-02-12T16:03:34 - INFO | received on stdout: \r\n[Thread-20] 2024-02-12T16:03:34 - DEBUG | received on stderr: error: pathspec 'update' did not match any file(s) known to git\r\n````\r\n\r\n### Screenshots\r\n\r\nNone\r\n\r\n### Additional information\r\n\r\nSnippet for from the settings:\r\n\r\n```yaml\r\nscm_track_enabled: true\r\nscm_track_mode: \"git\"\r\nscm_track_author: \"Cobbler <cobbler-scm-track@cobbler.arch.nue2.suse.org>\"\r\n# scm_push_script: \"git push\"\r\nscm_push_script: \"\"\r\n```\n", "before_files": [{"content": "\"\"\"\nCobbler Trigger Module that puts the content of the Cobbler data directory under version control. Depending on\n``scm_track_mode`` in the settings, this can either be git or Mercurial.\n\"\"\"\n\n# SPDX-License-Identifier: GPL-2.0-or-later\n# SPDX-FileCopyrightText: Copyright 2009, Red Hat Inc.\n# SPDX-FileCopyrightText: Michael DeHaan <michael.dehaan AT gmail>\n\n\nimport os\nfrom typing import TYPE_CHECKING, Any\n\nfrom cobbler import utils\nfrom cobbler.cexceptions import CX\n\nif TYPE_CHECKING:\n    from cobbler.api import CobblerAPI\n\n\ndef register() -> str:\n    \"\"\"\n    This pure python trigger acts as if it were a legacy shell-trigger, but is much faster. The return of this method\n    indicates the trigger type\n    :return: Always: ``/var/lib/cobbler/triggers/change/*``\n    \"\"\"\n\n    return \"/var/lib/cobbler/triggers/change/*\"\n\n\ndef run(api: \"CobblerAPI\", args: Any):\n    \"\"\"\n    Runs the trigger, meaning in this case track any changed which happen to a config or data file.\n\n    :param api: The api instance of the Cobbler server. Used to look up if scm_track_enabled is true.\n    :param args: The parameter is currently unused for this trigger.\n    :return: 0 on success, otherwise an exception is risen.\n    \"\"\"\n    settings = api.settings()\n\n    if not settings.scm_track_enabled:\n        # feature disabled\n        return 0\n\n    mode = str(settings.scm_track_mode).lower()\n    author = str(settings.scm_track_author)\n    push_script = str(settings.scm_push_script)\n\n    if mode == \"git\":\n        old_dir = os.getcwd()\n        os.chdir(\"/var/lib/cobbler\")\n        if os.getcwd() != \"/var/lib/cobbler\":\n            raise CX(\"danger will robinson\")\n\n        if not os.path.exists(\"/var/lib/cobbler/.git\"):\n            utils.subprocess_call([\"git\", \"init\"], shell=False)\n\n        # FIXME: If we know the remote user of an XMLRPC call use them as the author\n        utils.subprocess_call([\"git\", \"add\", \"--all\", \"collections\"], shell=False)\n        utils.subprocess_call([\"git\", \"add\", \"--all\", \"templates\"], shell=False)\n        utils.subprocess_call([\"git\", \"add\", \"--all\", \"snippets\"], shell=False)\n        utils.subprocess_call(\n            [\"git\", \"commit\", \"-m\", \"API update\", \"--author\", author], shell=False\n        )\n\n        if push_script:\n            utils.subprocess_call([push_script], shell=False)\n\n        os.chdir(old_dir)\n        return 0\n\n    if mode == \"hg\":\n        # use mercurial\n        old_dir = os.getcwd()\n        os.chdir(\"/var/lib/cobbler\")\n        if os.getcwd() != \"/var/lib/cobbler\":\n            raise CX(\"danger will robinson\")\n\n        if not os.path.exists(\"/var/lib/cobbler/.hg\"):\n            utils.subprocess_call([\"hg\", \"init\"], shell=False)\n\n        # FIXME: If we know the remote user of an XMLRPC call use them as the user\n        utils.subprocess_call([\"hg\", \"add collections\"], shell=False)\n        utils.subprocess_call([\"hg\", \"add templates\"], shell=False)\n        utils.subprocess_call([\"hg\", \"add snippets\"], shell=False)\n        utils.subprocess_call(\n            [\"hg\", \"commit\", \"-m\", \"API\", \"update\", \"--user\", author], shell=False\n        )\n\n        if push_script:\n            utils.subprocess_call([push_script], shell=False)\n\n        os.chdir(old_dir)\n        return 0\n\n    raise CX(f\"currently unsupported SCM type: {mode}\")\n", "path": "cobbler/modules/scm_track.py"}], "after_files": [{"content": "\"\"\"\nCobbler Trigger Module that puts the content of the Cobbler data directory under version control. Depending on\n``scm_track_mode`` in the settings, this can either be git or Mercurial.\n\"\"\"\n\n# SPDX-License-Identifier: GPL-2.0-or-later\n# SPDX-FileCopyrightText: Copyright 2009, Red Hat Inc.\n# SPDX-FileCopyrightText: Michael DeHaan <michael.dehaan AT gmail>\n\n\nimport os\nfrom typing import TYPE_CHECKING, Any\n\nfrom cobbler import utils\nfrom cobbler.cexceptions import CX\n\nif TYPE_CHECKING:\n    from cobbler.api import CobblerAPI\n\n\ndef register() -> str:\n    \"\"\"\n    This pure python trigger acts as if it were a legacy shell-trigger, but is much faster. The return of this method\n    indicates the trigger type\n    :return: Always: ``/var/lib/cobbler/triggers/change/*``\n    \"\"\"\n\n    return \"/var/lib/cobbler/triggers/change/*\"\n\n\ndef run(api: \"CobblerAPI\", args: Any):\n    \"\"\"\n    Runs the trigger, meaning in this case track any changed which happen to a config or data file.\n\n    :param api: The api instance of the Cobbler server. Used to look up if scm_track_enabled is true.\n    :param args: The parameter is currently unused for this trigger.\n    :return: 0 on success, otherwise an exception is risen.\n    \"\"\"\n    settings = api.settings()\n\n    if not settings.scm_track_enabled:\n        # feature disabled\n        return 0\n\n    mode = str(settings.scm_track_mode).lower()\n    author = str(settings.scm_track_author)\n    push_script = str(settings.scm_push_script)\n\n    if mode == \"git\":\n        old_dir = os.getcwd()\n        os.chdir(\"/var/lib/cobbler\")\n        if os.getcwd() != \"/var/lib/cobbler\":\n            raise CX(\"danger will robinson\")\n\n        if not os.path.exists(\"/var/lib/cobbler/.git\"):\n            utils.subprocess_call([\"git\", \"init\"], shell=False)\n\n        # FIXME: If we know the remote user of an XMLRPC call use them as the author\n        utils.subprocess_call([\"git\", \"add\", \"--all\", \"collections\"], shell=False)\n        utils.subprocess_call([\"git\", \"add\", \"--all\", \"templates\"], shell=False)\n        utils.subprocess_call([\"git\", \"add\", \"--all\", \"snippets\"], shell=False)\n        utils.subprocess_call(\n            [\"git\", \"commit\", \"-m\", \"API update\", \"--author\", author], shell=False\n        )\n\n        if push_script:\n            utils.subprocess_call(push_script.split(\" \"), shell=False)\n\n        os.chdir(old_dir)\n        return 0\n\n    if mode == \"hg\":\n        # use mercurial\n        old_dir = os.getcwd()\n        os.chdir(\"/var/lib/cobbler\")\n        if os.getcwd() != \"/var/lib/cobbler\":\n            raise CX(\"danger will robinson\")\n\n        if not os.path.exists(\"/var/lib/cobbler/.hg\"):\n            utils.subprocess_call([\"hg\", \"init\"], shell=False)\n\n        # FIXME: If we know the remote user of an XMLRPC call use them as the user\n        utils.subprocess_call([\"hg\", \"add collections\"], shell=False)\n        utils.subprocess_call([\"hg\", \"add templates\"], shell=False)\n        utils.subprocess_call([\"hg\", \"add snippets\"], shell=False)\n        utils.subprocess_call(\n            [\"hg\", \"commit\", \"-m\", \"API update\", \"--user\", author], shell=False\n        )\n\n        if push_script:\n            utils.subprocess_call(push_script.split(\" \"), shell=False)\n\n        os.chdir(old_dir)\n        return 0\n\n    raise CX(f\"currently unsupported SCM type: {mode}\")\n", "path": "cobbler/modules/scm_track.py"}]}