Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests incompatible with Git<2.28 #386

Closed
jedie opened this issue Aug 29, 2022 · 1 comment · Fixed by #427
Closed

Tests incompatible with Git<2.28 #386

jedie opened this issue Aug 29, 2022 · 1 comment · Fixed by #427
Assignees
Labels
Milestone

Comments

@jedie
Copy link
Contributor

jedie commented Aug 29, 2022

I tried to create a dev setup to contribute. (Sadly https://github.com/akaihola/darker/blob/master/CONTRIBUTING.rst doesn't contain how to get started)

Running tests i get this error:

    def check_call(*popenargs, **kwargs):
        """Run command with arguments.  Wait for command to complete.  If
        the exit code was zero then return, otherwise raise
        CalledProcessError.  The CalledProcessError object will have the
        return code in the returncode attribute.
    
        The arguments are the same as for the call function.  Example:
    
        check_call(["ls", "-l"])
        """
        retcode = call(*popenargs, **kwargs)
        if retcode:
            cmd = kwargs.get("args")
            if cmd is None:
                cmd = popenargs[0]
>           raise CalledProcessError(retcode, cmd)
E           subprocess.CalledProcessError: Command '['git', 'init', '--initial-branch=master']' returned non-zero exit status 129.

/usr/lib/python3.9/subprocess.py:373: CalledProcessError
---------------------------- Captured stderr setup -----------------------------
error: unknown option `initial-branch=master'
usage: git init [-q | --quiet] [--bare] [--template=<template-directory>] [--shared[=<permissions>]] [<directory>]

    --template <template-directory>
                          directory from which templates will be used
    --bare                create a bare repository
    --shared[=<permissions>]
                          specify that the git repository is to be shared amongst several users
    -q, --quiet           be quiet
    --separate-git-dir <gitdir>
                          separate git dir from working tree

I have git --version is: 2.25.1

@akaihola
Copy link
Owner

Yes, seems that the git init --initial-branch=... option only appeared in Git 2.28.

I think we should parse the output of git --version and leave the --initial-branch=master option out if the installed Git version is older than 2.28.

@akaihola akaihola self-assigned this Aug 29, 2022
@akaihola akaihola added the CI label Aug 29, 2022
@akaihola akaihola added this to the 1.5.1 milestone Aug 29, 2022
@akaihola akaihola changed the title GitRepoFixture.create_repository(): error: unknown option `initial-branch=master' Tests incompatible with Git<2.28 Aug 29, 2022
@akaihola akaihola modified the milestones: 1.5.1, 1.6.0 Sep 13, 2022
@akaihola akaihola modified the milestones: 1.6.0, 1.6.1 Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants