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

bug: `git pull` does not clean up after itself if it fails

From
NZNikolai Zaki <nikolai-waleed.zaki@charite.de>
Date
Jul 15, 2024, 11:19 UTC
Message-ID
<0cc13c53-1d8d-4501-89f2-e8329bc95485@charite.de>

What did you do before the bug happened? (Steps to reproduce your issue) In your local repo have a directory that you cannot write to. Pull from a remote that has changes/new files in that directory.

What did you expect to happen? (Expected behavior) The pull fails and the local repo in the same state as before.

What happened instead? (Actual behavior) All changes to writeable files are applied and all new files in writeable dirs are added. The local HEAD however remained the same.

What's different between what you expected and what actually happened? A failed `git pull` inadvertently creates changes and untracked files.

Anything else you want to add: I created this bugreport on my local machine, but I first noticed this on git version 2.25.1 under Ubuntu (uname: Linux s-c05-mvi-civdb 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux)

[System Info] git version: git version 2.45.2 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 6.9.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 28 Jun 2024 04:32:50 +0000 x86_64 compiler info: gnuc: 14.1 libc info: glibc: 2.39 $SHELL (typically, interactive shell): /bin/zsh

-- 
Best,
Nikolai
Next: Jeff King
Message 1 of 3 in “bug: `git pull` does not clean up after itself if it fails”
  1. Nikolai ZakiJul 15, 2024
  2. Jeff KingJul 17, 2024
  3. Nikolai ZakiJul 17, 2024

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.