Skip to content

Instantly share code, notes, and snippets.

@fracek
Created July 4, 2014 07:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fracek/d5ffef7c65229ae9b9a1 to your computer and use it in GitHub Desktop.
Save fracek/d5ffef7c65229ae9b9a1 to your computer and use it in GitHub Desktop.
define git-options <git-clone-options*>
option git-clone-options$version => version;
option git-clone-options$checkout-opts => checkout-options;
option git-clone-options$remote-callbacks => remote-callbacks;
option git-clone-options$bare => bare?;
option git-clone-options$ignore-cert-errors => ignore-cert-errors;
option git-clone-options$local => local?;
option git-clone-options$remote-name => remote-name;
option git-clone-options$checkout-branch => checkout-branch;
option git-clone-options$signature => signature;
end git-options;
define method git-clone
(url :: <string>, path :: <string>,
#key checkout-options = #f,
remote-callbacks = #f,
bare? = #f,
ignore-cert-errors = #f,
local? = #f,
remote-name = #f,
checkout-branch = #f,
signature = #f)
=> (err, repo)
let options
= if (checkout-options | remote-callbacks | bare? | ignore-cert-errors |
local? | remote-name | checkout-branch | signature)
make(<git-clone-options*>,
checkout-options: checkout-options,
remote-callbacks: remote-callbacks,
bare?: bare?,
ignore-cert-errors: ignore-cert-errors,
local?: local?,
remote-name: remote-name,
checkout-branch: checkout-branch,
signature: signature)
else
null-pointer(<git-clone-options*>)
end if;
%git-clone(url, path, options)
end method git-clone;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment