Git-Wrapper
Git-Wrapper copied to clipboard
Make clone more better
So, based on this:
15:39 (genehack) how about something like: ->clone( $repo , [ $path | %options ]);
15:39 * perigrin nods
15:39 (perigrin) that would work
15:39 (perigrin) $options{prefix} = /tmp
15:39 (genehack) i'm trying to think if there's anything in '%options' other than root_dir
15:39 (perigrin) would *certainly* solve my problem.
15:39 (genehack) or prefix
15:39 (perigrin) well there could be
15:39 (perigrin) bare => 1
15:39 (perigrin) would set --bare
15:39 (perigrin) etc.
15:40 (genehack) right, i need to review what options 'clone' can take
also add a 'humanish' filter to turn foo/bar/baz.git into baz; make that the default $path when it's not given (just like git clone)
Note that #29 maybe solves this too? (Well, the initial part, not the 'humanish' part or the default $path part)
/cc @perigrin
So there is no way to do a clone with Git::Wrapper?
@toddr No, calling ->clone() works just fine. This is about improving it, not that it doesn't work.
I was thinking about:
my $g = Git::Wrapper->clone( { url => $url, dir => $repo_path, git_binary => $git_binary } )
It's still an object method, not a class one:
my $gw = Git::Wrapper->new("/path/to/where/you/want/to/clone");
$gw->clone("repo:/clone/url");