// Copyright 2014 The Gogs Authors. All rights reserved.// Use of this source code is governed by a MIT-style// license that can be found in the LICENSE file.packagegitimport("path/filepath""strings")constprettyLogFormat=`--pretty=format:%H`funcRefEndName(refStrstring)string{index:=strings.LastIndex(refStr,"/")ifindex!=-1{returnrefStr[index+1:]}returnrefStr}// If the object is stored in its own file (i.e not in a pack file),// this function returns the full path to the object file.// It does not test if the file exists.funcfilepathFromSHA1(rootdir,sha1string)string{returnfilepath.Join(rootdir,"objects",sha1[:2],sha1[2:])}