From: Herman van Rink <r...@initfour.nl>

Signed-off-by: Paul Campbell <pcampb...@kemitix.net>

Conflicts:
        git-subtree.sh
---
 contrib/subtree/git-subtree.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index ae7d1fe..84c90c7 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -806,6 +806,7 @@ cmd_from-submodule()
        ensure_clean
 
        local submodule_sha=$(git submodule status $prefix | cut -d ' ' -f 2)
+       local submodule_orig_repo=$(git config --file .gitmodules 
submodule.$prefix.url)
 
        # Remove references to submodule.
        git config --remove-section submodule.$prefix
@@ -824,6 +825,10 @@ cmd_from-submodule()
        # subtree add from submodule repo.
        cmd_add_repository $tmp_repo HEAD
 
+       # Update .gittrees with the original repo url
+       git config --file .gittrees --unset subtree.$prefix.url
+       git config --file .gittrees subtree.$prefix.url $submodule_orig_repo
+
        # Remove submodule repo.
        rm -rf $tmp_repo
 }
-- 
1.8.2.rc1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to