func GetCommit(oid string) (tree string, parent string, message string, err error) {
	data, t, err := storage.GetObject(oid)
	if err != nil {
		return "", "", "", err
	}
	if t != storage.COMMIT {
		return "", "", "", errors.New("The object " + oid + " is not a commit : " + string(t))
	}
	commitLines := strings.Split(data, "\n")
	for i, l := range commitLines {
		token := strings.Split(l, " ")
		if i < 2 {
			_type := storage.ObjectType(token[0])
			_oid := token[1]
			if _type == storage.PARENT {
				parent = _oid
			} else if _type == storage.TREE {
				tree = _oid
			}
		} else {
			message += l
		}
	}
	return tree, parent, message, nil
}
/*
GetCommit return the tree oid, its parent's commit oid, and its associated message
*/
GetCommit return the tree oid, its parent's commit oid, and its associated message
/ * GetCommit return the tree oid its parent ' s commit oid and its associated message * /
func GetCommit(oid string) (tree string, parent string, message string, err error) {
	data, t, err := storage.GetObject(oid)
	if err != nil {
		return "", "", "", err
	}
	if t != storage.COMMIT {
		return "", "", "", errors.New("The object " + oid + " is not a commit : " + string(t))
	}
	commitLines := strings.Split(data, "\n")
	for i, l := range commitLines {
		token := strings.Split(l, " ")
		if i < 2 {
			_type := storage.ObjectType(token[0])
			_oid := token[1]
			if _type == storage.PARENT {
				parent = _oid
			} else if _type == storage.TREE {
				tree = _oid
			}
		} else {
			message += l
		}
	}
	return tree, parent, message, nil
}
func GetCommit ( oid string ) ( tree string , parent string , message string , err error ) { data , t , err := storage . GetObject ( oid ) if err != nil { return " " , " " , " " , err } if t != storage . COMMIT { return " " , " " , " " , errors . New ( " " + oid + " " + string ( t ) ) } commitLines := strings . Split ( data , " \n " ) for i , l := range commitLines { token := strings . Split ( l , " " ) if i < 2 { _type := storage . ObjectType ( token [ 0 ] ) _oid := token [ 1 ] if _type == storage . PARENT { parent = _oid } else if _type == storage . TREE { tree = _oid } } else { message += l } } return tree , parent , message , nil }
GetCommit return the tree oid, its parent's commit oid, and its associated message
GetCommit return the tree oid its parent ' s commit oid and its associated message