2009-06-24 12:48:01 +00:00
|
|
|
source $stdenv/setup
|
|
|
|
|
|
|
|
header "exporting $url (rev $rev) into $out"
|
|
|
|
|
2009-11-08 01:51:20 +00:00
|
|
|
git clone "$url" $out
|
2009-06-24 12:48:01 +00:00
|
|
|
if test -n "$rev"; then
|
|
|
|
cd $out
|
2010-05-19 21:27:01 +00:00
|
|
|
|
|
|
|
# Track all remote branches so that revisions like
|
|
|
|
# `t/foo@{2010-05-12}' are correctly resolved. Failing to do that,
|
|
|
|
# Git bails out with an "invalid reference" error.
|
|
|
|
for branch in $(git branch -rl | grep -v ' origin/master$')
|
|
|
|
do
|
|
|
|
git branch --track "$(echo $branch | sed -es,origin/,,g)" "$branch"
|
|
|
|
done
|
|
|
|
|
|
|
|
git checkout "$rev" --
|
2009-06-24 12:48:01 +00:00
|
|
|
fi
|
|
|
|
|
2010-01-27 12:12:35 +00:00
|
|
|
if test -z "$leaveDotGit"; then
|
|
|
|
find $out -name .git\* | xargs rm -rf
|
|
|
|
fi
|
2009-06-24 12:48:01 +00:00
|
|
|
|
2010-01-27 12:12:35 +00:00
|
|
|
stopNest
|