You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pytmc template needs some version control information to annotate the st.cmd file.
If this is run in a case where there is no git information, the code as-written hits an infinite loop and runs forever.
"""Given a file, find the git repository root (if it exists)."""
whilefn:
if (fn/".git").exists():
returnfn
fn=fn.parent
This function is a while loop that continually checks the parent directory if it has not yet found a .git directory.
Unfortunately, there is no termination for this loop in the case of no .git directories at all, and also unfortunately, the parent of the root directory in pathlib is the root directory again, so this loop quickly reaches the point where it is repeatedly stat-ing for /.git on the filesystem infinitely.
To resolve, this should either raise an error or have fallback behavior for cases with no git repository information.
The text was updated successfully, but these errors were encountered:
pytmc template
needs some version control information to annotate the st.cmd file.If this is run in a case where there is no git information, the code as-written hits an infinite loop and runs forever.
This infinite loop happens in
find_git_root
atpytmc/pytmc/bin/template.py
Lines 130 to 135 in 2c4f412
This function is a while loop that continually checks the parent directory if it has not yet found a .git directory.
Unfortunately, there is no termination for this loop in the case of no .git directories at all, and also unfortunately, the parent of the root directory in pathlib is the root directory again, so this loop quickly reaches the point where it is repeatedly stat-ing for
/.git
on the filesystem infinitely.To resolve, this should either raise an error or have fallback behavior for cases with no git repository information.
The text was updated successfully, but these errors were encountered: