 		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

		.set("tagger")
		.set("target", "targetId")
		.set("type")
	return @
Tag.prototype.target = (cb) ->
	@repository.object @targetId, @type, cb

Gitteh.Remote = Remote = (@repository, nativeRemote) ->
	_priv = createPrivate @
	_priv.native = nativeRemote
	_priv.connected = false

	if nativeRemote not instanceof NativeRemote
		throw new Error "Don't construct me, see Repository.remote()"

	Object.defineProperty @, "connected",
		get: -> return _priv.connected
		enumerable: true
		configurable: false

