 		cb: type: "function"
 	bindings.initRepository path, bare, wrapCallback cb, (repo) ->
 		cb null, new Repository repo
-
 Gitteh.clone = =>
 	[url, path, cb] = args
 		url: type: "string"

	return @

Gitteh.Refspec = Refspec = (src, dst) ->
	srcRoot = src
	srcRoot = srcRoot[0...-1] if srcRoot? and srcRoot[-1..] is "*"
	dstRoot = dst
	dstRoot = dstRoot[0...-1] if dstRoot? and dstRoot[-1..] is "*"
	immutable(@, {src, dst})
		.set("src")
		.set("dst")
	@matchesSrc = (ref) =>
		return false if ref.length <= srcRoot.length
		return ref.indexOf(srcRoot) is 0
	@matchesDst = (ref) =>
		return false if ref.length <= dstRoot.length
		return ref.indexOf(dstRoot) is 0
	@transformTo = (ref) =>
		throw new Error "Ref doesn't match src." if not @matchesSrc ref
		return "#{dst[0...-2]}#{ref[(src.length-2)..]}"
	@transformFrom = (ref) =>
		throw new Error "Ref doesn't match dst." if not @matchesDst ref
		return "#{src[0...-2]}#{ref[(dst.length-2)..]}"
	return @

Gitteh.Commit = Commit = (@repository, obj) ->
	obj.author = new Signature obj.author

			return o
	}

oidRegex = /^[a-zA-Z0-9]{0,40}$/
args.validators.oid = (val) ->
	return false if typeof val isnt "string"
	return false if not oidRegex.test val
	return false if val.length < minOidLength
	return true

objectTypes = ["any", "blob", "commit", "tag", "tree"]
args.validators.objectType = (val) ->
	return objectTypes.indexOf val > -1

remoteDirs = ["push", "fetch"]
args.validators.remoteDir = (val) ->
	return remoteDirs.indexOf val > -1

checkOid = (str, allowLookup = true) ->
	throw new TypeError "OID should be a string" if typeof str isnt "string"
	throw new TypeError "Invalid OID" if not oidRegex.test str
	throw new Error "OID is too short" if str.length < bindings.minOidLength
	throw new TypeError "Invalid OID" if not allowLookup and str.length isnt 40

Gitteh.Signature = Signature = (obj) ->
	immutable(@, obj)
		.set("name")
		.set("email")
