aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2015-01-02 22:01:39 -0500
committerTeddy Wing2015-01-02 22:01:39 -0500
commitfaad1a93bf0cbadc06f245a46d1057ced4f3710c (patch)
treec2ada2eaa3b8a592fe82bc8633d8ed630db3f921
parent7d6ab76e8c5b382aff8a0cb7812c904f6dda9272 (diff)
downloadgit-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.
-rw-r--r--utils/utils.go6
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 ""