Unexpected behavior when cloning bare repositories · Issue #9270 · cli/cli · GitHub
Skip to content

Unexpected behavior when cloning bare repositories #9270

Description

@hyperrealist

Describe the bug

Currently gh fails to configure bare repositories after cloning because it is looking for a directory named <repo name> rather than <repo name>.git.

Steps to reproduce the behavior

Clone any repository as a bare repository using --bare gitflag.

$ gh repo clone hyperrealist/tiled -- --bare

In abvove example you'll see something like the following:

Cloning into bare repository 'tiled.git'...
remote: Enumerating objects: 16472, done.
remote: Counting objects: 100% (376/376), done.
remote: Compressing objects: 100% (113/113), done.
remote: Total 16472 (delta 283), reused 336 (delta 263), pack-reused 16096
Receiving objects: 100% (16472/16472), 4.30 MiB | 15.40 MiB/s, done.
Resolving deltas: 100% (12482/12482), done.
failed to run git: fatal: cannot change to 'tiled': No such file or directory

Expected vs actual behavior

As a consequence, the cloned repository will not be fully configured as expected. For example, the upstream repository is not set up.

$ cd tiled.git
$ git remote -v
origin	https://github.com/hyperrealist/tiled.git (fetch)
origin	https://github.com/hyperrealist/tiled.git (push)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggh-reporelating to the gh repo commandpriority-2Affects more than a few users but doesn't prevent core functions

    Type

    No type

    Fields

    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