git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Maximilian Reichel <reichemn@icloud.com>
To: git@vger.kernel.org
Subject: pull fails after commit dry-run
Date: Mon, 21 Feb 2022 09:26:52 +0100	[thread overview]
Message-ID: <9FF5E3B7-E3EC-4E71-A701-D43B8B092F7C@icloud.com> (raw)

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

             reply	other threads:[~2022-02-21 17:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-21  8:26 Maximilian Reichel [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-02-22  6:11 pull fails after commit dry-run Maximilian Reichel
2022-02-22 23:15 ` Rafael Silva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9FF5E3B7-E3EC-4E71-A701-D43B8B092F7C@icloud.com \
    --to=reichemn@icloud.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).