revert: remove dirname -- flag for broader compatibility

Remove the '--' end-of-options flag from dirname command as it's not
  universally supported across all POSIX implementations. While '--' is
  good practice for handling filenames starting with dashes, dirname
  rarely encounters such edge cases in practice, and the compatibility
  issue is more pressing.

  Some older or minimal POSIX shells don't recognize '--' with dirname,
  causing the script to fail. Since we're already in a controlled loop
  walking up directory paths that come from pwd, the risk of dash-prefixed
  paths is negligible.

  Trade-off: Prioritizing compatibility over theoretical edge case protection.
This commit is contained in:
J. Kirby Ross
2025-08-21 08:45:49 -07:00
parent 1968083e76
commit 6603544958

View File

@@ -81,7 +81,7 @@ get_worktree_path() {
return 1
fi
check_dir=$(dirname -- "${check_dir}")
check_dir=$(dirname "${check_dir}")
done
debug_log "No git repository found"