summaryrefslogtreecommitdiff
path: root/builtin-tag.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2007-07-20 12:06:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-07-21 23:51:14 (GMT)
commit4d87b9c5db2590f7616fedfc0a538fc78f528e14 (patch)
treee6422ae717c460cb0e53852507af05dec979328d /builtin-tag.c
parent62e09ce998dd7f6b844deb650101c743a5c4ce50 (diff)
downloadgit-4d87b9c5db2590f7616fedfc0a538fc78f528e14.zip
git-4d87b9c5db2590f7616fedfc0a538fc78f528e14.tar.gz
git-4d87b9c5db2590f7616fedfc0a538fc78f528e14.tar.bz2
launch_editor(): Heed GIT_EDITOR and core.editor settings
In the commit 'Add GIT_EDITOR environment and core.editor configuration variables', this was done for the shell scripts. Port it over to builtin-tag's version of launch_editor(), which is just about to be refactored into editor.c. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-tag.c')
-rw-r--r--builtin-tag.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/builtin-tag.c b/builtin-tag.c
index 507f510..81d37ce 100644
--- a/builtin-tag.c
+++ b/builtin-tag.c
@@ -24,7 +24,11 @@ static void launch_editor(const char *path, char **buffer, unsigned long *len)
const char *args[3];
int fd;
- editor = getenv("VISUAL");
+ editor = getenv("GIT_EDITOR");
+ if (!editor && editor_program)
+ editor = editor_program;
+ if (!editor)
+ editor = getenv("VISUAL");
if (!editor)
editor = getenv("EDITOR");
@@ -249,9 +253,9 @@ static void create_tag(const unsigned char *object, const char *tag,
char *message, int sign, unsigned char *result)
{
enum object_type type;
- char header_buf[1024], *buffer;
+ char header_buf[1024], *buffer = NULL;
int header_len, max_size;
- unsigned long size;
+ unsigned long size = 0;
type = sha1_object_info(object, NULL);
if (type <= 0)