[commit: ghc] master: sync-all: delete dead code calling gitInitSubmodules (bd07942)
git at git.haskell.org
git at git.haskell.org
Thu Jun 26 02:54:31 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/bd07942e4d1cb92d9c1eb8b776f38a95aa8bbe7e/ghc
>---------------------------------------------------------------
commit bd07942e4d1cb92d9c1eb8b776f38a95aa8bbe7e
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date: Wed Jun 11 17:12:35 2014 +0200
sync-all: delete dead code calling gitInitSubmodules
When running './sync-all get', 'git submodule init' has to be (and is
always) executed, since .gitmodules might contain new submodules (see
commit c3db2b). As a result, after cloning the ghc repo and running the
initial './sync-all get', .git/config will always contain some submodule
sections. Therefore it is not needed to check for this on every
subsequent get or pull, and this code can be deleted.
>---------------------------------------------------------------
bd07942e4d1cb92d9c1eb8b776f38a95aa8bbe7e
sync-all | 21 ---------------------
1 file changed, 21 deletions(-)
diff --git a/sync-all b/sync-all
index e0e1f55..7b9d220 100755
--- a/sync-all
+++ b/sync-all
@@ -69,16 +69,6 @@ sub parsePackages {
}
}
-sub tryReadFile {
- my $filename = shift;
- my @lines;
-
- open (FH, $filename) or return "";
- @lines = <FH>;
- close FH;
- return join('', @lines);
-}
-
sub message {
if ($verbose >= 2) {
print "@_\n";
@@ -903,17 +893,7 @@ sub main {
&gitInitSubmodules(@submodule_args);
}
- if ($command eq "pull") {
- my $gitConfig = &tryReadFile(".git/config");
- if ($gitConfig !~ /submodule/) {
- &gitInitSubmodules(@submodule_args);
- }
- }
if ($command eq "get" or $command eq "pull") {
- my $gitConfig = &tryReadFile(".git/config");
- if ($gitConfig !~ /submodule/) {
- &gitInitSubmodules(@submodule_args);
- }
&git(".", "submodule", "update", @submodule_args);
}
}
@@ -1030,4 +1010,3 @@ EOF
}
main(@ARGV);
-
More information about the ghc-commits
mailing list