write_file_v(): do not leave incomplete line at the end
[gitweb.git] / submodule.c
index 15e90d1c10ebc9ecb0825f731b33d81cf3d9b4d5..5519f11fdb1e078b5cebb3f38f295b0d2db29f92 100644 (file)
@@ -993,7 +993,7 @@ static void print_commit(struct commit *commit)
 {
        struct strbuf sb = STRBUF_INIT;
        struct pretty_print_context ctx = {0};
-       ctx.date_mode = DATE_NORMAL;
+       ctx.date_mode.type = DATE_NORMAL;
        format_commit_message(commit, " %h: %m %s", &sb, &ctx);
        fprintf(stderr, "%s\n", sb.buf);
        strbuf_release(&sb);
@@ -1103,7 +1103,7 @@ void connect_work_tree_and_git_dir(const char *work_tree, const char *git_dir)
 
        /* Update gitfile */
        strbuf_addf(&file_name, "%s/.git", work_tree);
-       write_file(file_name.buf, 1, "gitdir: %s\n",
+       write_file(file_name.buf, "gitdir: %s\n",
                   relative_path(git_dir, real_work_tree, &rel_path));
 
        /* Update core.worktree setting */