aboutsummaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorSebastien Devaux <sebastien.devaux@laposte.net>2019-08-24 22:42:25 +0200
committerSebastien Devaux <sebastien.devaux@laposte.net>2019-08-24 22:42:25 +0200
commit7e123fbfcae76e3ad188cfa5e98c27adcde8d6d7 (patch)
tree8dab22f51e01ebf286ba9a9c0cc61244a313586f /input
parent91f563da5f508cfcc5dfe6418e2f6333e247ec6e (diff)
downloadgit-bug-7e123fbfcae76e3ad188cfa5e98c27adcde8d6d7.tar.gz
issue 178: fetch the repo dir with rev-parse --git-dir
Since is returns the .git dir directly, it is not more needed to concatenate .git.
Diffstat (limited to 'input')
-rw-r--r--input/input.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/input/input.go b/input/input.go
index 789373b0..ca787ceb 100644
--- a/input/input.go
+++ b/input/input.go
@@ -239,7 +239,7 @@ func QueryEditorInput(repo repository.RepoCommon, preQuery string) (string, erro
// launchEditorWithTemplate will launch an editor as launchEditor do, but with a
// provided template.
func launchEditorWithTemplate(repo repository.RepoCommon, fileName string, template string) (string, error) {
- path := fmt.Sprintf("%s/.git/%s", repo.GetPath(), fileName)
+ path := fmt.Sprintf("%s/%s", repo.GetPath(), fileName)
err := ioutil.WriteFile(path, []byte(template), 0644)
@@ -254,13 +254,13 @@ func launchEditorWithTemplate(repo repository.RepoCommon, fileName string, templ
// method blocks until the editor command has returned.
//
// The specified filename should be a temporary file and provided as a relative path
-// from the repo (e.g. "FILENAME" will be converted to ".git/FILENAME"). This file
+// from the repo (e.g. "FILENAME" will be converted to "[<reporoot>/].git/FILENAME"). This file
// will be deleted after the editor is closed and its contents have been read.
//
// This method returns the text that was read from the temporary file, or
// an error if any step in the process failed.
func launchEditor(repo repository.RepoCommon, fileName string) (string, error) {
- path := fmt.Sprintf("%s/.git/%s", repo.GetPath(), fileName)
+ path := fmt.Sprintf("%s/%s", repo.GetPath(), fileName)
defer os.Remove(path)
editor, err := repo.GetCoreEditor()