[commit: ghc] master: Use a simpler way of finding the current git branch in sync-all (0ae042d)

Ian Lynagh igloo at earth.li
Sat Apr 20 02:05:03 CEST 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : master

https://github.com/ghc/ghc/commit/0ae042d370fa3ed1cc184b858e9120ef0bfdb198

>---------------------------------------------------------------

commit 0ae042d370fa3ed1cc184b858e9120ef0bfdb198
Author: Ian Lynagh <ian at well-typed.com>
Date:   Fri Apr 19 13:53:28 2013 +0100

    Use a simpler way of finding the current git branch in sync-all

>---------------------------------------------------------------

 sync-all | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sync-all b/sync-all
index 71d707e..bcd5d75 100755
--- a/sync-all
+++ b/sync-all
@@ -29,7 +29,7 @@ sub getrepo {
         # Figure out where to get the other repositories from,
         # based on where this GHC repo came from.
         my $git_dir = $bare_flag ? "--git-dir=ghc.git" : "";
-        my $branch  = `git $git_dir branch | grep "\* " | sed "s/^\* //"`; chomp $branch;
+        my $branch  = `git $git_dir rev-parse --abbrev-ref HEAD`;          chomp $branch;
         my $remote  = `git $git_dir config branch.$branch.remote`;         chomp $remote;
         if ($remote eq "") {
             # remotes are not mandatory for branches (e.g. not recorded by default for bare repos)





More information about the ghc-commits mailing list