git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] Fail to add a module in a subdirectory if module is already cloned
@ 2012-01-24 19:11 Jehan Bing
  2012-01-24 21:10 ` Jens Lehmann
  0 siblings, 1 reply; 9+ messages in thread
From: Jehan Bing @ 2012-01-24 19:11 UTC (permalink / raw)
  To: git

Hi,

I'm getting an error if I try to add a module in a subdirectory and that 
module is already cloned.
Here are the steps to reproduce (git 1.7.8.3):

git init module
cd module
echo foo > foo
git add foo
git commit -m "init"
cd ..
git init super
cd super
echo foo > foo
git add foo
git commit -m "init"
git branch b1
git branch b2
git checkout b1
git submodule add ../module lib/module
git commit -m "module"
git checkout b2
rm -rf lib
git submodule add ../module lib/module

The last command returns:
     fatal: Not a git repository: ../.git/modules/lib/module
     Unable to checkout submodule 'lib/module'

The file lib/modules/.git contains:
     gitdir: ../.git/modules/lib/module
(missing an additional "../")

In branch b1, after adding the module, the file contained the full path:
     gitdir: /[...]/super/.git/modules/lib/module
Or contains the correct relative path after checking out b1 later:
     gitdir: ../../.git/modules/lib/module


Regards,
	Jehan

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

end of thread, other threads:[~2012-01-25  1:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-24 19:11 [BUG] Fail to add a module in a subdirectory if module is already cloned Jehan Bing
2012-01-24 21:10 ` Jens Lehmann
2012-01-24 21:13   ` Jens Lehmann
2012-01-24 21:24   ` Junio C Hamano
2012-01-24 21:44     ` Jens Lehmann
2012-01-24 22:14       ` Jens Lehmann
2012-01-24 22:38         ` Junio C Hamano
2012-01-24 21:49   ` [PATCH] submodule add: fix breakage when re-adding a deep submodule Jens Lehmann
2012-01-25  1:48     ` Jehan Bing

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).