Skip to content

Conversation

@dan-woz
Copy link
Contributor

@dan-woz dan-woz commented Oct 3, 2025

Current version creates a file named nul in my current working directory. I think the intention is to discard this output instead.

@StackInTheWild StackInTheWild requested a review from Copilot October 6, 2025 11:24
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where the git ls-files command was incorrectly redirecting stderr to a file named "nul" instead of properly discarding the output. The fix changes the redirection from 2>nul to 2>/dev/null to properly suppress error messages.

  • Changed stderr redirection from creating a "nul" file to discarding output via /dev/null

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

local files = {}

local handle = io.popen("git ls-files 2>nul")
local handle = io.popen("git ls-files 2>/dev/null")
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix uses /dev/null which is Unix-specific and won't work on Windows. Consider using a cross-platform solution like 2>nul on Windows and 2>/dev/null on Unix, or check if the git command supports --quiet flag to suppress errors.

Suggested change
local handle = io.popen("git ls-files 2>/dev/null")
local dir_sep = package.config:sub(1,1)
local null_redir = (dir_sep == '\\') and "2>nul" or "2>/dev/null"
local handle = io.popen("git ls-files " .. null_redir)

Copilot uses AI. Check for mistakes.
@StackInTheWild StackInTheWild merged commit 775f829 into StackInTheWild:main Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants