Git development
 help / color / mirror / Atom feed
* git-add fails after file type change
@ 2006-12-16 18:16 Steven Grimm
  2006-12-16 18:31 ` Jakub Narebski
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Steven Grimm @ 2006-12-16 18:16 UTC (permalink / raw)
  To: Git Mailing List

In the course of experimenting with using git for my snapshot backups, I 
ran into what looks like a bug in git-add: it croaks when it tries to 
add a file whose type has changed, specifically when a directory gets 
moved and a symbolic link is put in the old location pointing to the new 
one. Here's a simple test case:

$ git init-db
defaulting to local storage area
$ mkdir dir
$ echo foo > dir/file
$ git add .
$ git commit -m "initial commit" -a
Committing initial tree f4bc9c50d08b041f5e096fa68e243c34170f1cd8
 create mode 100644 dir/file
$ mv dir dir.real
$ ln -s dir.real dir
$ git add .
fatal: unable to add dir to index

Is "git add ." the wrong thing to do here? I have been using it as a 
generic "pick up all the files I haven't added yet" command. Or is this 
a bug?

For what it's worth, "git update-index dir" and "git update-index --add 
dir" both fail too.


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

end of thread, other threads:[~2006-12-17  9:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-16 18:16 git-add fails after file type change Steven Grimm
2006-12-16 18:31 ` Jakub Narebski
2006-12-16 18:44   ` Steven Grimm
2006-12-16 18:35 ` A Large Angry SCM
2006-12-16 21:58   ` Junio C Hamano
2006-12-16 22:40     ` Steven Grimm
2006-12-17  0:19   ` Steven Grimm
2006-12-17  0:46     ` Junio C Hamano
2006-12-17  1:39       ` Junio C Hamano
2006-12-17  9:11         ` [PATCH] git-add: remove conflicting entry when adding Junio C Hamano
2006-12-16 19:23 ` git-add fails after file type change 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