Skip to content

Instantly share code, notes, and snippets.

@fracek
Created June 27, 2014 08:43
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/9afab034f8a582492e3b to your computer and use it in GitHub Desktop.
Save fracek/9afab034f8a582492e3b to your computer and use it in GitHub Desktop.
define method git-repository-init
(path :: <string>,
#key bare? :: <boolean> = #f,
flags :: false-or(<integer>) = #f,
mode :: false-or(<integer>) = #f,
working-directory :: false-or(<string>) = #f,
description :: false-or(<string>) = #f,
template-path :: false-or(<string>) = #f,
initial-head :: false-or(<string>) = #f,
origin-url :: false-or(<string>) = #f)
=> (err, repo)
if (flags | mode | working-directory | description | template-path | initial-head | origin-url)
let opts = make(<git-repository-init-options*>);
if (flags)
git_repository_init_options$flags(opts) := flags;
end if;
if (mode)
git_repository_init_options$mode(opts) := mode;
end if;
%git-repository-init-ext(path, options)
else
%git-repository-init(path, if (bare?) 1 else 0 end)
end if
end method git-repository-init;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment