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

pull fails after commit dry-run

From
MRMaximilian Reichel <reichemn@icloud.com>
Date
Feb 22, 2022, 06:11 UTC
Message-ID
<B0458F2D-C6B9-41AE-8F2F-39C1D2AEE6BD@icloud.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) Running the following two scripts.

Script one: '#!/bin/bash

mkdir parent git -C parent init git -C parent -c user.name="P" -c user.email="m@example.com" commit -m one --allow-empty

mkdir cloneDir cd cloneDir git init

git pull -v --rebase "../parent" echo git pull exit code: $?'

script two: '#!/bin/bash

mkdir parent git -C parent init git -C parent -c user.name="P" -c user.email="m@example.com" commit -m one --allow-empty

mkdir cloneDir cd cloneDir git init git commit -m "foo" --dry-run git pull -v --rebase "../parent" echo git pull exit code: $?'

What did you expect to happen? (Expected behavior)
Since they only differ in the 'git commit -m "foo" --dry-run' invocation, I would expect the same outcome for both scripts.
Expected output of the last two lines:
'From ../parent
* branch            HEAD       -> FETCH_HEAD
git pull exit code: 0'

What happened instead? (Actual behavior) The second script is not able to pull from ../parent. Output of the last lines of the second script: 'fatal: Updating an unborn branch with changes added to the index. git pull exit code: 128’

Anything else you want to add: I tested this on git 2.35.1, 2.34.1 and 2.21.0 and they are all affected.

[System Info] git version: git version 2.35.1 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 5.10.25-linuxkit #1 SMP Tue Mar 23 09:27:39 UTC 2021 x86_64 compiler info: gnuc: 10.2 libc info: glibc: 2.31 $SHELL (typically, interactive shell): <unset>

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

Next: Rafael Silva
Message 1 of 2 in “pull fails after commit dry-run”
  1. Maximilian ReichelFeb 22, 2022
  2. Rafael SilvaFeb 22, 2022

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.