From d52abf37893c90c228ca043623a9bda214382239 Mon Sep 17 00:00:00 2001 From: Guan Junchun Date: Fri, 11 Oct 2013 18:16:17 +0800 Subject: gbp-clone: support cloning to a specific directory Closes: #725666 Signed-off-by: Guan Junchun Signed-off-by: Markus Lehtonen --- gbp/scripts/clone.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gbp/scripts/clone.py b/gbp/scripts/clone.py index 5f21329..15e1174 100755 --- a/gbp/scripts/clone.py +++ b/gbp/scripts/clone.py @@ -59,21 +59,23 @@ def main(argv): (options, args) = parse_args(argv) - if len(args) != 2: + if len(args) < 2: gbp.log.err("Need a repository to clone.") return 1 else: source = args[1] + clone_to, auto_name = (os.path.curdir, True) if len(args) < 3 else (args[2], False) try: - GitRepository(os.path.curdir) + GitRepository(clone_to) gbp.log.err("Can't run inside a git repository.") return 1 except GitRepositoryError: pass try: - repo = DebianGitRepository.clone(os.path.curdir, source, options.depth) + repo = DebianGitRepository.clone(clone_to, source, options.depth, + auto_name=auto_name) os.chdir(repo.path) # Reparse the config files of the cloned repository so we pick up the -- cgit v1.2.3