Merge branch 'kh/tutorial-grammofix'
[gitweb.git] / builtin / merge.c
index 0ae099f746680e5c2fcc55dff56624da1619f2f1..0070bf255612ea9d4826720df7a77dd8ccb762e8 100644 (file)
@@ -634,7 +634,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
 {
        static struct lock_file lock;
 
-       hold_locked_index(&lock, 1);
+       hold_locked_index(&lock, LOCK_DIE_ON_ERROR);
        refresh_cache(REFRESH_QUIET);
        if (active_cache_changed &&
            write_locked_index(&the_index, &lock, COMMIT_LOCK))
@@ -671,7 +671,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
                for (j = common; j; j = j->next)
                        commit_list_insert(j->item, &reversed);
 
-               hold_locked_index(&lock, 1);
+               hold_locked_index(&lock, LOCK_DIE_ON_ERROR);
                clean = merge_recursive(&o, head,
                                remoteheads->item, reversed, &result);
                if (clean < 0)
@@ -781,7 +781,7 @@ static int merge_trivial(struct commit *head, struct commit_list *remoteheads)
        struct commit_list *parents, **pptr = &parents;
        static struct lock_file lock;
 
-       hold_locked_index(&lock, 1);
+       hold_locked_index(&lock, LOCK_DIE_ON_ERROR);
        refresh_cache(REFRESH_QUIET);
        if (active_cache_changed &&
            write_locked_index(&the_index, &lock, COMMIT_LOCK))
@@ -940,7 +940,7 @@ static void write_merge_state(struct commit_list *remoteheads)
 
        strbuf_reset(&buf);
        if (fast_forward == FF_NO)
-               strbuf_addf(&buf, "no-ff");
+               strbuf_addstr(&buf, "no-ff");
        write_file_buf(git_path_merge_mode(), buf.buf, buf.len);
 }
 
@@ -1374,12 +1374,11 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
                struct commit *commit;
 
                if (verbosity >= 0) {
-                       char from[GIT_SHA1_HEXSZ + 1], to[GIT_SHA1_HEXSZ + 1];
-                       find_unique_abbrev_r(from, head_commit->object.oid.hash,
-                                             DEFAULT_ABBREV);
-                       find_unique_abbrev_r(to, remoteheads->item->object.oid.hash,
-                                             DEFAULT_ABBREV);
-                       printf(_("Updating %s..%s\n"), from, to);
+                       printf(_("Updating %s..%s\n"),
+                              find_unique_abbrev(head_commit->object.oid.hash,
+                                                 DEFAULT_ABBREV),
+                              find_unique_abbrev(remoteheads->item->object.oid.hash,
+                                                 DEFAULT_ABBREV));
                }
                strbuf_addstr(&msg, "Fast-forward");
                if (have_message)