Author: jamessan
Date: 2009-01-13 17:59:56 +0000 (Tue, 13 Jan 2009)
New Revision: 1788

Modified:
   trunk/debian/changelog
   trunk/scripts/debcheckout.pl
Log:
* debcheckout:
  + Determine the actual HEAD ref to skip when first cloning a git repo
    instead of assuming it is master.  This ensures branches don't get
    skipped when specifying extra branches to track with --git-track.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2009-01-13 17:29:02 UTC (rev 1787)
+++ trunk/debian/changelog      2009-01-13 17:59:56 UTC (rev 1788)
@@ -12,8 +12,12 @@
     directory names, in case $TMPDIR contains spaces.
 
   [ James Vega ]
-  * debcheckout: Filter TopGit branches out of the list of branches given to
-    --git-track since "tg populate" already created them.
+  * debcheckout:
+    + Filter TopGit branches out of the list of branches given to
+      --git-track since "tg populate" already created them.
+    + Determine the actual HEAD ref to skip when first cloning a git repo
+      instead of assuming it is master.  This ensures branches don't get
+      skipped when specifying extra branches to track with --git-track.
 
  -- Patrick Schoenfeld <[email protected]>  Fri, 09 Jan 2009 23:01:08 +0100
 

Modified: trunk/scripts/debcheckout.pl
===================================================================
--- trunk/scripts/debcheckout.pl        2009-01-13 17:29:02 UTC (rev 1787)
+++ trunk/scripts/debcheckout.pl        2009-01-13 17:59:56 UTC (rev 1788)
@@ -923,8 +923,15 @@
            }
            # Filter out any branches already populated via TopGit
            my @tgheads = split ' ', $$tg_info{'top-bases'};
+           my $master = 'master';
+           if (open(HEAD, "env GIT_DIR=\"$wcdir/.git\" git symbolic-ref HEAD 
|")) {
+               $master = <HEAD>;
+               chomp $master;
+               $master =~ s...@refs/heads/@@;
+           }
+           close(HEAD);
            foreach my $head (@heads) {
-               next if $head eq 'master';
+               next if $head eq $master;
                next if grep { $head eq $_ } @tgheads;
                my $cmd = "cd $wcdir";
                $cmd .= " && git branch --track $head remotes/origin/$head";



-- 
To unsubscribe, send mail to [email protected].

Reply via email to