fullPathName ensures the configured Dir value is present in the filename and returns a filename with the Dir prefixed before the input filename if necessary.
(filename string)
| 94 | // fullPathName ensures the configured Dir value is present in the filename and |
| 95 | // returns a filename with the Dir prefixed before the input filename if necessary. |
| 96 | func (gh *Storage) fullPathName(filename string) string { |
| 97 | if strings.HasPrefix(filename, gh.Dir) { |
| 98 | return filename |
| 99 | } else { |
| 100 | return filepath.Join(gh.Dir, filename) |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | // readFile reads a file from the Git repository at its latest revision. |
| 105 | // This method returns the plaintext contents, the SHA associated with the contents |