diff options
author | Simon Marlow <marlowsd@gmail.com> | 2011-04-05 11:08:35 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2011-04-05 12:20:06 +0100 |
commit | c3740c90e450910f3921eab862f174dcd73b1363 (patch) | |
tree | 3f05fa42c3c16fd14189c61df4fc6d36266e0128 /sync-all | |
parent | db485571de4216b379fad54b377fa970d204bcae (diff) | |
download | haskell-c3740c90e450910f3921eab862f174dcd73b1363.tar.gz |
'fetch' and 'new' can take branch names as arguments (defaulting to 'origin')
e.g.
./sync-all -r ~/git/ghc-working remote add working
./sync-all fetch working
Diffstat (limited to 'sync-all')
-rwxr-xr-x | sync-all | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -238,6 +238,12 @@ sub scmall { if ($subcommand ne 'add' && $subcommand ne 'rm') { help(); } + } elsif ($command eq 'new' || $command eq 'fetch') { + if (@_ < 1) { + $branch_name = 'origin'; + } else { + $branch_name = shift; + } } for $line (@packages) { @@ -316,10 +322,10 @@ sub scmall { @scm_args = ("remote", "set-url", "--push", "origin", $path); } elsif ($command =~ /^fetch$/) { - @scm_args = ("fetch", "origin"); + @scm_args = ("fetch", "$branch_name"); } elsif ($command =~ /^new$/) { - @scm_args = ("log", "origin.."); + @scm_args = ("log", "$branch_name.."); } elsif ($command =~ /^remote$/) { if ($subcommand eq 'add') { |