threads / patch / 33132

patch, 19 partsfrom-submodule: add url to .gittrees

Subject: [PATCH 13/19] from-submodule: add url to .gittrees

## tl;dr

One message between Mar 9, 2013 and Mar 9, 2013. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Paul Campbell· Mar 9, 2013, 19:28 UTC · lore
>From e1b71e3bf8abaea424972d13ba028b911b07d85a Mon Sep 17 00:00:00 2001
From: Paul Campbell <pcampbell@kemitix.net>
Date: Sat, 9 Mar 2013 18:34:31 +0000
Subject: [PATCH 13/19] from-submodule: add url to .gittrees
Conflicts:
	git-subtree.sh
Original-Author: Herman van Rink <rink@initfour.nl>
Conflicts-resolved-by: Paul Campbell <pcampbell@kemitix.net>
---
 contrib/subtree/git-subtree.sh | 5 +++++
 1 file changed, 5 insertions(+)
Show changes to contrib/subtree/git-subtree.sh +5 −0
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


-- 
Paul [W] Campbell

← back to recent threads