pre-commit-hooks-django
pre-commit-hooks-django copied to clipboard
Git rebase exception
Hello, today I have got a exception while trying to reword commit message via interactive git rebase.
Steps to reproduce:
-
git rebase -i HEAD~4 -
rewordfor the first commit in the list
Untracked Django migrations checker...........................................................Failed
- hook id: check-untracked-migrations
- exit code: 1
fatal: ref HEAD is not a symbolic ref
Traceback (most recent call last):
File "/Users/faunris/.cache/pre-commit/repohi2le7su/py_env-python3.12/bin/check-untracked-migrations", line 8, in <module>
sys.exit(main())
^^^^^^
File "/Users/faunris/.cache/pre-commit/repohi2le7su/py_env-python3.12/lib/python3.12/site-packages/hooks/check_untracked_migrations.py", line 16, in main
current_branch = get_current_branch()
^^^^^^^^^^^^^^^^^^^^
File "/Users/faunris/.cache/pre-commit/repohi2le7su/py_env-python3.12/lib/python3.12/site-packages/hooks/utils.py", line 14, in get_current_branch
output = subprocess.check_output(BRANCH_CMD)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/faunris/.pyenv/versions/3.12.10/lib/python3.12/subprocess.py", line 466, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/faunris/.pyenv/versions/3.12.10/lib/python3.12/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'symbolic-ref', '--short', 'HEAD']' returned non-zero exit status 128.
.pre-commit-config.yaml
- repo: https://github.com/ecugol/pre-commit-hooks-django
rev: v0.4.0
hooks:
- id: check-untracked-migrations