Skip to content

Can't view issues for repos where I don't have local write permissions #1925

Description

@jmdejong

Describe the bug

In a multi-user linux system it can be possible to have read permissions to all the files in a local git repo, but not write permission.
If I try view the issues for such a repository I get a permission error message that locking .git/config falied.

For git issue list the error is:

error: could not lock config file .git/config: Permission denied
git: exit status 255

For git issue view 1 the error is:

could not determine base repo: error: could not lock config file .git/config: Permission denied
git: exit status 255

gh version 1.0.0

Steps to reproduce the behavior

  1. Create a local repository that has a github repository as a remote
  2. Log in as another user that does not have write permissions to any of the files in the repository
  3. Try gh issue list or gh issue view 1
  4. The permission error now appears

Expected vs actual behavior

I expected to be able to view the issue list or the issue itself because viewing does not modify anything.
Insead I got a permission error.

Logs

me@host:~$ cd /home/otheruser/somerepo
me@host:/home/otheruser/somerepo$ gh issue list
error: could not lock config file .git/config: Permission denied
git: exit status 255
me@host:/home/otheruser/somerepo$ gh issue view 1
could not determine base repo: error: could not lock config file .git/config: Permission denied
git: exit status 255
me@host:/home/otheruser/somerepo$ ls -ld .git/config
-rw-rw-r-- 1 otheruser otheruser 338 Mar  9  2017 .git/config

Only tested on linux:

$ uname -a
Linux hostname 5.4.0-26-generic #30-Ubuntu SMP Mon Apr 20 16:58:30 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggh-issuerelating to the gh issue commandpriority-3Affects a small number of users or is largely cosmetic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions