diff options
author | Teddy Wing | 2015-01-02 22:01:39 -0500 |
---|---|---|
committer | Teddy Wing | 2015-01-02 22:01:39 -0500 |
commit | faad1a93bf0cbadc06f245a46d1057ced4f3710c (patch) | |
tree | c2ada2eaa3b8a592fe82bc8633d8ed630db3f921 /utils | |
parent | 7d6ab76e8c5b382aff8a0cb7812c904f6dda9272 (diff) | |
download | git-checkout-history-faad1a93bf0cbadc06f245a46d1057ced4f3710c.tar.bz2 |
utils.go: Trim trailing newline on repo directory
The repository directory location string had a trailing newline at the
end which I don't want because this is going to be the key of a hash, so
it doesn't make sense to have it.
Diffstat (limited to 'utils')
-rw-r--r-- | utils/utils.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/utils.go b/utils/utils.go index 79b2ca2..0c7760e 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -52,7 +52,11 @@ func currentGitDir() string { if err := cmd.Run(); err != nil { panic(err) } - return git_directory.String() + + dir_trimmed := git_directory.String() + + // Trim newline at the end of the directory string + return dir_trimmed[:len(dir_trimmed) - 1] } return "" |