diff options
4 files changed, 15 insertions, 1 deletions
diff --git a/Annex/Fixup.hs b/Annex/Fixup.hs index 4d9afea91..1cde86390 100644 --- a/Annex/Fixup.hs +++ b/Annex/Fixup.hs @@ -90,8 +90,9 @@ fixupSubmodule r@(Repo { location = l@(Local { worktree = Just w, gitdir = d }) where dotgit = w </> ".git" replacedotgit = whenM (doesFileExist dotgit) $ do + linktarget <- relPathDirToFile w d nukeFile dotgit - createSymbolicLink (w </> d) dotgit + createSymbolicLink linktarget dotgit maybe (error "unset core.worktree failed") (\_ -> return ()) =<< Git.Config.unset "core.worktree" r fixupSubmodule r _ = return r diff --git a/debian/changelog b/debian/changelog index 0b2f214a7..c6eb05287 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,9 @@ git-annex (6.20160127) UNRELEASED; urgency=medium expression. * Brought back the dbus and xmpp build flags, so build from source can be done without C libraries that may be hard to install. + * init: Fix bugs in submodule .git symlink fixup, that occurred when + initializing in a subdirectory of a submodule and a submodule of a + submodule. -- Joey Hess <id@joeyh.name> Thu, 28 Jan 2016 13:53:09 -0400 diff --git a/doc/bugs/use_of_annex_in_submodule_replaces_.git_with_incorrect_symlink.mdwn b/doc/bugs/use_of_annex_in_submodule_replaces_.git_with_incorrect_symlink.mdwn index a6e14a288..43295e7a8 100644 --- a/doc/bugs/use_of_annex_in_submodule_replaces_.git_with_incorrect_symlink.mdwn +++ b/doc/bugs/use_of_annex_in_submodule_replaces_.git_with_incorrect_symlink.mdwn @@ -45,3 +45,5 @@ upgrade supported from repository versions: 0 1 2 4 5 """]] [[!meta author=yoh]] + +> [[fixed|done]] diff --git a/doc/bugs/use_of_annex_in_submodule_replaces_.git_with_incorrect_symlink/comment_3_7781f13c070a3c79f5b63d3172b0280a._comment b/doc/bugs/use_of_annex_in_submodule_replaces_.git_with_incorrect_symlink/comment_3_7781f13c070a3c79f5b63d3172b0280a._comment new file mode 100644 index 000000000..4d519264b --- /dev/null +++ b/doc/bugs/use_of_annex_in_submodule_replaces_.git_with_incorrect_symlink/comment_3_7781f13c070a3c79f5b63d3172b0280a._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 3""" + date="2016-02-08T18:27:32Z" + content=""" +Yeah, it was running git annex init in the subdir of the submodule that +triggered the bug. Easy fix, also fixes init in submodules of submodules. +"""]] |