Code

git-config.txt: fix a typo
[git.git] / builtin-revert.c
index f3d452418c25b0d95a911a050f75ba190d6513c1..74845ef8e6f9c635bbafbf5dfea5e73cf6e11aa0 100644 (file)
  */
 
 static const char * const revert_usage[] = {
-       "git-revert [options] <commit-ish>",
+       "git revert [options] <commit-ish>",
        NULL
 };
 
 static const char * const cherry_pick_usage[] = {
-       "git-cherry-pick [options] <commit-ish>",
+       "git cherry-pick [options] <commit-ish>",
        NULL
 };
 
@@ -180,7 +180,7 @@ static void set_author_ident_env(const char *message)
                        email++;
                        timestamp = strchr(email, '>');
                        if (!timestamp)
-                               die ("Could not extract author email from %s",
+                               die ("Could not extract author time from %s",
                                        sha1_to_hex(commit->object.sha1));
                        *timestamp = '\0';
                        for (timestamp++; *timestamp && isspace(*timestamp);
@@ -269,7 +269,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)
        int i;
        char *oneline, *reencoded_message = NULL;
        const char *message, *encoding;
-       const char *defmsg = xstrdup(git_path("MERGE_MSG"));
+       char *defmsg = git_pathdup("MERGE_MSG");
 
        git_config(git_default_config, NULL);
        me = action == REVERT ? "revert" : "cherry-pick";
@@ -338,7 +338,8 @@ static int revert_or_cherry_pick(int argc, const char **argv)
         * reverse of it if we are revert.
         */
 
-       msg_fd = hold_lock_file_for_update(&msg_file, defmsg, 1);
+       msg_fd = hold_lock_file_for_update(&msg_file, defmsg,
+                                          LOCK_DIE_ON_ERROR);
 
        encoding = get_encoding(message);
        if (!encoding)
@@ -426,6 +427,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)
                return execv_git_cmd(args);
        }
        free(reencoded_message);
+       free(defmsg);
 
        return 0;
 }