git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bugreport
@ 2024-01-19 13:25 Frank Schwidom
  2024-01-19 23:14 ` Bugreport brian m. carlson
  0 siblings, 1 reply; 6+ messages in thread
From: Frank Schwidom @ 2024-01-19 13:25 UTC (permalink / raw)
  To: git


This bug exists in possibly all git versions.

$ git init
$ touch a.txt
$ ln -s a.txt d
$ git add .
$ git commit -m + .
[master (root-commit) f6b4468] +
 2 files changed, 1 insertion(+)
 create mode 100644 a.txt
 create mode 120000 d
$ ls -la
total 12
drwxr-xr-x 3 ox ox 4096 Jan 19 14:10 .
drwxr-xr-x 4 ox ox 4096 Jan 19 14:04 ..
drwxr-xr-x 8 ox ox 4096 Jan 19 14:10 .git
-rw-r--r-- 1 ox ox    0 Jan 19 14:10 a.txt
lrwxrwxrwx 1 ox ox    5 Jan 19 14:10 d -> a.txt
$ rm d
$ mkdir d
$ touch d/b.txt
$ git add .
$ git commit . -m +
error: 'd' does not have a commit checked out
fatal: updating files failed


# I expect that git just replaces the link by the directory. But it makes problems.

# Workaround:

$ rm -rf d
$ git add .
$ git commit -m + .
[master 522e6db] +
 1 file changed, 1 deletion(-)
 delete mode 120000 d
$ mkdir d
$ touch d/b.txt
$ git add .
$ git commit -m + .
[master 8a125ee] +
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 d/b.txt

[System Info]
git version:
git version 2.43.0
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 6.1.0-8-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.25-1 (2023-04-22) x86_64
compiler info: gnuc: 13.2
libc info: glibc: 2.37
$SHELL (typically, interactive shell): /bin/bash


[Enabled Hooks]

Thanks in advance,
Frank Schwidom

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-01-25 18:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-19 13:25 Bugreport Frank Schwidom
2024-01-19 23:14 ` Bugreport brian m. carlson
2024-01-20  0:46   ` partial commit of file-to-directory change, was Bugreport Jeff King
2024-01-20  0:55     ` Junio C Hamano
2024-01-20  1:22     ` Junio C Hamano
2024-01-25 18:54     ` Junio C Hamano

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 NNTP newsgroup(s).