summaryrefslogtreecommitdiff
path: root/builtin-tag.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-12-05 01:16:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-12-05 01:16:33 (GMT)
commit31cbb5d96151891491168d3f813e6898c9ef825b (patch)
treea7f3fe36377aad5251d643cfb426bac207cb003f /builtin-tag.c
parent9bbe6db85f368fc4f75cc9f6c4bfaf2269bf0068 (diff)
parent5241b6bfe2285a6da598a0348c37b77964035bc8 (diff)
downloadgit-31cbb5d96151891491168d3f813e6898c9ef825b.zip
git-31cbb5d96151891491168d3f813e6898c9ef825b.tar.gz
git-31cbb5d96151891491168d3f813e6898c9ef825b.tar.bz2
Merge branch 'kh/commit'
* kh/commit: (33 commits) git-commit --allow-empty git-commit: Allow to amend a merge commit that does not change the tree quote_path: fix collapsing of relative paths Make git status usage say git status instead of git commit Fix --signoff in builtin-commit differently. git-commit: clean up die messages Do not generate full commit log message if it is not going to be used Remove git-status from list of scripts as it is builtin Fix off-by-one error when truncating the diff out of the commit message. builtin-commit.c: export GIT_INDEX_FILE for launch_editor as well. Add a few more tests for git-commit builtin-commit: Include the diff in the commit message when verbose. builtin-commit: fix partial-commit support Fix add_files_to_cache() to take pathspec, not user specified list of files Export three helper functions from ls-files builtin-commit: run commit-msg hook with correct message file builtin-commit: do not color status output shown in the message template file_exists(): dangling symlinks do exist Replace "runstatus" with "status" in the tests t7501-commit: Add test for git commit <file> with dirty index. ...
Diffstat (limited to 'builtin-tag.c')
-rw-r--r--builtin-tag.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/builtin-tag.c b/builtin-tag.c
index 114c684..729389b 100644
--- a/builtin-tag.c
+++ b/builtin-tag.c
@@ -23,11 +23,9 @@ static const char * const git_tag_usage[] = {
static char signingkey[1000];
-static void launch_editor(const char *path, struct strbuf *buffer)
+void launch_editor(const char *path, struct strbuf *buffer, const char *const *env)
{
const char *editor, *terminal;
- struct child_process child;
- const char *args[3];
editor = getenv("GIT_EDITOR");
if (!editor && editor_program)
@@ -48,14 +46,12 @@ static void launch_editor(const char *path, struct strbuf *buffer)
if (!editor)
editor = "vi";
- memset(&child, 0, sizeof(child));
- child.argv = args;
- args[0] = editor;
- args[1] = path;
- args[2] = NULL;
+ if (strcmp(editor, ":")) {
+ const char *args[] = { editor, path, NULL };
- if (run_command(&child))
- die("There was a problem with the editor %s.", editor);
+ if (run_command_v_opt_cd_env(args, 0, NULL, env))
+ die("There was a problem with the editor %s.", editor);
+ }
if (strbuf_read_file(buffer, path, 0) < 0)
die("could not read message file '%s': %s",
@@ -322,7 +318,7 @@ static void create_tag(const unsigned char *object, const char *tag,
write_or_die(fd, tag_template, strlen(tag_template));
close(fd);
- launch_editor(path, buf);
+ launch_editor(path, buf, NULL);
unlink(path);
free(path);