Repository: xonsh/xonsh

Issue:
When rebasing gitstatus raises "_GSField.updator() takes 2 positional arguments but 3 were given"
## xonfig

<details>

```
+------------------+-----------------+
| xonsh            | 0.13.3          |
| Python           | 3.10.7          |
| PLY              | 3.11            |
| have readline    | True            |
| prompt toolkit   | 3.0.31          |
| shell type       | prompt_toolkit  |
| history backend  | json            |
| pygments         | None            |
| on posix         | True            |
| on linux         | True            |
| distro           | unknown         |
| on wsl           | False           |
| on darwin        | False           |
| on windows       | False           |
| on cygwin        | False           |
| on msys2         | False           |
| is superuser     | True            |
| default encoding | utf-8           |
| xonsh encoding   | utf-8           |
| encoding errors  | surrogateescape |
| xontrib          | []              |
| RC file 1        | /root/.xonshrc  |
+------------------+-----------------+
```

</details>

## Expected Behavior

No error

## Current Behavior

Xonsh prints the following error when generating the prompt:

```
prompt: error: on field 'gitstatus'
xonsh: For full traceback set: $XONSH_SHOW_TRACEBACK = True
TypeError: _GSField.updator() takes 2 positional arguments but 3 were given
```

Full traceback below.

### Traceback (if applicable)

<details>

```
{ERROR:gitstatus} # 
prompt: error: on field 'gitstatus'
xonsh: To log full traceback to a file set: $XONSH_TRACEBACK_LOGFILE = <filename>
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/base.py", line 133, in _get_field_value
    return self.fields.pick(field)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/base.py", line 381, in pick
    value.update(self)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/gitstatus.py", line 343, in update
    super().update(ctx)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/base.py", line 519, in update
    self.value = self.separator.join(self._collect(ctx))
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/base.py", line 514, in _collect
    yield format(ctx.pick(frag))
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/base.py", line 381, in pick
    value.update(self)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/gitstatus.py", line 126, in update
    self.updator(self, ctx)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/gitstatus.py", line 246, in get_gitstatus_info
    info = ctx.pick_val(porcelain)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/base.py", line 391, in pick_val
    val = self.pick(key)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/base.py", line 381, in pick
    value.update(self)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/gitstatus.py", line 126, in update
    self.updator(self, ctx)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/gitstatus.py", line 206, in porcelain
    branch = ctx.pick(tag_or_hash) or ""
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/base.py", line 381, in pick
    value.update(self)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/gitstatus.py", line 126, in update
    self.updator(self, ctx)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/gitstatus.py", line 146, in tag_or_hash
    fld.value = ctx.pick(tag) or ctx.pick(short_head)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/base.py", line 381, in pick
    value.update(self)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/gitstatus.py", line 126, in update
    self.updator(self, ctx)
TypeError: _GSField.updator() takes 2 positional arguments but 3 were given
```

</details>

## Steps to Reproduce

1. Set `.xonshrc` to this:

```
$PROMPT = (
    "{gitstatus} {prompt_end}{RESET} "
)
# you might also want to turn on:
# $XONSH_SHOW_TRACEBACK = True
```

2. Create a git repo with a few commits
3. `git rebase --interactive <old-commit>`
4. Set some commits to `edit` to pause the rebase at that commit
5. cd a xonsh shell to that git directory

## For community
⬇️  **Please click the 👍 reaction instead of leaving a `+1` or 👍  comment**



Discussion:

Resolving patch:
diff --git a/xonsh/prompt/gitstatus.py b/xonsh/prompt/gitstatus.py
--- a/xonsh/prompt/gitstatus.py
+++ b/xonsh/prompt/gitstatus.py
@@ -133,7 +133,7 @@ class _GSField(GitStatusPromptField):
 
     _args: "tuple[str, ...]" = ()
 
-    def updator(self, ctx):
+    def updator(self, fld, ctx):
         self.value = _get_sp_output(ctx.xsh, *self._args).strip()
 
 


Test patch: