// This file is generated by generate-std.joke script. Do not edit manually!

package git

import (
	. "github.com/candid82/joker/core"
)

var __add_commit__P ProcFn = __add_commit_
var add_commit_ Proc = Proc{Fn: __add_commit__P, Name: "add_commit_", Package: "std/git"}

func __add_commit_(_args []Object) Object {
	_c := len(_args)
	switch {
	case _c == 3:
		repo := ExtractGitRepo(_args, 0)
		msg := ExtractString(_args, 1)
		opts := ExtractMap(_args, 2)
		_res := addCommit(repo, msg, opts)
		return MakeString(_res)

	default:
		PanicArity(_c)
	}
	return NIL
}

var __add_path__P ProcFn = __add_path_
var add_path_ Proc = Proc{Fn: __add_path__P, Name: "add_path_", Package: "std/git"}

func __add_path_(_args []Object) Object {
	_c := len(_args)
	switch {
	case _c == 2:
		repo := ExtractGitRepo(_args, 0)
		path := ExtractString(_args, 1)
		_res := addPath(repo, path)
		return MakeString(_res)

	default:
		PanicArity(_c)
	}
	return NIL
}

var __commit__P ProcFn = __commit_
var commit_ Proc = Proc{Fn: __commit__P, Name: "commit_", Package: "std/git"}

func __commit_(_args []Object) Object {
	_c := len(_args)
	switch {
	case _c == 2:
		repo := ExtractGitRepo(_args, 0)
		hash := ExtractString(_args, 1)
		_res := findCommit(repo, hash)
		return _res

	default:
		PanicArity(_c)
	}
	return NIL
}

var __config__P ProcFn = __config_
var config_ Proc = Proc{Fn: __config__P, Name: "config_", Package: "std/git"}

func __config_(_args []Object) Object {
	_c := len(_args)
	switch {
	case _c == 1:
		repo := ExtractGitRepo(_args, 0)
		_res := config(repo)
		return _res

	default:
		PanicArity(_c)
	}
	return NIL
}

var __head__P ProcFn = __head_
var head_ Proc = Proc{Fn: __head__P, Name: "head_", Package: "std/git"}

func __head_(_args []Object) Object {
	_c := len(_args)
	switch {
	case _c == 1:
		repo := ExtractGitRepo(_args, 0)
		_res := head(repo)
		return _res

	default:
		PanicArity(_c)
	}
	return NIL
}

var __log__P ProcFn = __log_
var log_ Proc = Proc{Fn: __log__P, Name: "log_", Package: "std/git"}

func __log_(_args []Object) Object {
	_c := len(_args)
	switch {
	case _c == 2:
		repo := ExtractGitRepo(_args, 0)
		opts := ExtractMap(_args, 1)
		_res := log(repo, opts)
		return _res

	default:
		PanicArity(_c)
	}
	return NIL
}

var __object__P ProcFn = __object_
var object_ Proc = Proc{Fn: __object__P, Name: "object_", Package: "std/git"}

func __object_(_args []Object) Object {
	_c := len(_args)
	switch {
	case _c == 2:
		repo := ExtractGitRepo(_args, 0)
		hash := ExtractString(_args, 1)
		_res := findObject(repo, hash)
		return _res

	default:
		PanicArity(_c)
	}
	return NIL
}

var __open__P ProcFn = __open_
var open_ Proc = Proc{Fn: __open__P, Name: "open_", Package: "std/git"}

func __open_(_args []Object) Object {
	_c := len(_args)
	switch {
	case _c == 1:
		path := ExtractString(_args, 0)
		_res := open(path)
		return MakeGitRepo(_res)

	default:
		PanicArity(_c)
	}
	return NIL
}

var __ref__P ProcFn = __ref_
var ref_ Proc = Proc{Fn: __ref__P, Name: "ref_", Package: "std/git"}

func __ref_(_args []Object) Object {
	_c := len(_args)
	switch {
	case _c == 3:
		repo := ExtractGitRepo(_args, 0)
		name := ExtractString(_args, 1)
		resolved := ExtractBoolean(_args, 2)
		_res := ref(repo, name, resolved)
		return _res

	default:
		PanicArity(_c)
	}
	return NIL
}

var __resolve_revision__P ProcFn = __resolve_revision_
var resolve_revision_ Proc = Proc{Fn: __resolve_revision__P, Name: "resolve_revision_", Package: "std/git"}

func __resolve_revision_(_args []Object) Object {
	_c := len(_args)
	switch {
	case _c == 2:
		repo := ExtractGitRepo(_args, 0)
		revision := ExtractString(_args, 1)
		_res := resolveRevision(repo, revision)
		return MakeString(_res)

	default:
		PanicArity(_c)
	}
	return NIL
}

func Init() {

	InternsOrThunks()
}

var gitNamespace = GLOBAL_ENV.EnsureSymbolIsLib(MakeSymbol("joker.git"))

func init() {
	gitNamespace.Lazy = Init
}
