git/list[1] front-page[2] threads[3] people[4] search[5] about
 

bug: conflicting core.bare setting causes segfault during bare clone

From
VJVusich, Joseph <jvusich@amazon.com>
Date
Mar 3, 2021, 00:06 UTC
Message-ID
<D99DD9AD-54E5-4357-BA50-8B9CAE23084E@amazon.com>

Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)
$ env | grep GIT

$ git config --list user.email=jvusich@amazon.com user.name=Joseph Vusich core.bare=false

$ git clone --bare https://github.com/josephvusich/fixture Cloning into bare repository 'fixture.git'... zsh: segmentation fault /opt/local/bin/git clone --bare https://github.com/josephvusich/fixture

What did you expect to happen? (Expected behavior)
"git clone --bare" should clone a bare repository, regardless of the core.bare setting in the global config
What happened instead? (Actual behavior)
"git clone --bare" causes a segfault if the global gitconfig has core.bare=false
Anything else you want to add:
* Non-bare clones still work when core.bare=false
* Bare clones only work when core.bare=true, or if core.bare is absent from gitconfig
* Started failing with Git 2.30.0, also fails on 2.30.1, but succeeds on 2.29.2
* Issue reproduced on multiple machines, running Ubuntu, Mac OS, and Alpine Linux
* Running with all TRACEs enabled shows only one additional line prior to "Cloning"
    15:38:08.567292 git.c:444  trace: built-in: git clone --bare https://github.com/josephvusich/fixture
* The fixture.git directory is created prior to the segfault, the fixture.git/config file content is below:
  [core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

[System Info] git version: git version 2.30.1 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Darwin 19.6.0 Darwin Kernel Version 19.6.0: Tue Jan 12 22:13:05 PST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64 x86_64 compiler info: clang: 12.0.0 (clang-1200.0.32.2) libc info: no libc information available $SHELL (typically, interactive shell): /bin/zsh

[Enabled Hooks] not run from a git repository - no hooks to show

Next: brian m. carlson
Message 1 of 10 in “bug: conflicting core.bare setting causes segfault during bare clone”
  1. Vusich, JosephMar 3, 2021
  2. brian m. carlsonMar 3, 2021
  3. Junio C HamanoMar 4, 2021
  4. Vusich, JosephMar 4, 2021
  5. builtin/init-db: handle bare clones when core.bare set to falsebrian m. carlson, Mar 8, 2021
  6. Eric SunshineMar 8, 2021
  7. brian m. carlsonMar 8, 2021
  8. builtin/init-db: handle bare clones when core.bare set to falsebrian m. carlson, Mar 10, 2021
  9. Junio C HamanoMar 10, 2021
  10. brian m. carlsonMar 10, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.