]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin-tag.c
Fix some printf format warnings
[thirdparty/git.git] / builtin-tag.c
index 080e04a8fc6fc1fc3f10f59a4c1f1aa067b81aa1..c4790185ebb9979a6772cf7159d16c2a1deeeaf3 100644 (file)
@@ -308,8 +308,7 @@ static void create_tag(const unsigned char *object, const char *tag,
                path = git_pathdup("TAG_EDITMSG");
                fd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0600);
                if (fd < 0)
-                       die("could not create file '%s': %s",
-                                               path, strerror(errno));
+                       die_errno("could not create file '%s'", path);
 
                if (!is_null_sha1(prev))
                        write_tag_body(fd, prev);
@@ -391,7 +390,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
                OPT_BOOLEAN('s', NULL, &sign, "annotated and GPG-signed tag"),
                OPT_STRING('u', NULL, &keyid, "key-id",
                                        "use another key to sign the tag"),
-               OPT_BOOLEAN('f', NULL, &force, "replace the tag if exists"),
+               OPT_BOOLEAN('f', "force", &force, "replace the tag if exists"),
 
                OPT_GROUP("Tag listing options"),
                {
@@ -443,11 +442,11 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
                else {
                        if (!strcmp(msgfile, "-")) {
                                if (strbuf_read(&buf, 0, 1024) < 0)
-                                       die("cannot read %s", msgfile);
+                                       die_errno("cannot read '%s'", msgfile);
                        } else {
                                if (strbuf_read_file(&buf, msgfile, 1024) < 0)
-                                       die("could not open or read '%s': %s",
-                                               msgfile, strerror(errno));
+                                       die_errno("could not open or read '%s'",
+                                               msgfile);
                        }
                }
        }