#!/bin/bash
set -e

REMOTE_BRANCHES="upstream pristine-tar"

PACKAGE="$1"
CLONE_URL="git@salsa.debian.org:ocaml-team"

if [ "$1" = "--no-ssh" ] ; then
  PACKAGE="$2"
  CLONE_URL="https://salsa.debian.org/ocaml-team"
fi

if [ -z "$PACKAGE" ] ; then
  echo "Usage: dom-git-checkout [ --no-ssh ] PKGNAME"
  exit 1
fi

echo "I: cloning remote repository"
gbp clone --pristine-tar "$CLONE_URL/$PACKAGE.git"

echo "I: all done, enjoy."
