Skip to content

git commands not running on Windows #671

@laurinius

Description

@laurinius

On windows executing the git command fails from the lua scripts.
It might have something to do with my repo path containing a space. Thought just putting quotes around it does not fix it, there might be strange behaviour in combination with the & concatenator as well.
io.popen("cd " .. repo .. CS .. "git status")
->

fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
     8,8792 LUA ERROR: script_manager.lua: get_current_repo_branch: 318: no current branch detected in repo_data

In my opinion a better solution would be to use the -C <path> argument of git for all commands instead of changing the directory, and also quoting the repo string:
io.popen("git -C \"" .. repo .. "\" status")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions