From b1c95e2300c56be57c770ec2e8e8a44db7c89995 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Fri, 28 Jun 2013 10:35:06 -0400 Subject: [PATCH] =?utf8?q?git-hg-sub-import:=20Ajout=20des=20subrepos=20?= =?utf8?q?=C3=A0=20.gitignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- scripts/git-hg-sub-import | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/git-hg-sub-import b/scripts/git-hg-sub-import index d5d947f..6d18dc3 100755 --- a/scripts/git-hg-sub-import +++ b/scripts/git-hg-sub-import @@ -53,6 +53,11 @@ if [ ! -f .hgsub ]; then exit 1 fi +if [ ! -f .gitignore ]; then + # We do not want to track .gitignore itself + echo ".gitignore" > .gitignore +fi + # Read lines from .hgsub while read sub; do # Remove CR (DOS) @@ -94,6 +99,11 @@ while read sub; do git checkout "branches/${branch}" cd .. fi + + if ! grep -q "${dest}" .gitignore ; then + # Ignore subrepo in top-level git repository + echo "${dest}" >> .gitignore + fi else pushd "${dest}" git pull -- 2.20.1