git-commit: allow --only to lose what was staged earlier.
[gitweb.git] / unpack-trees.c
index a20639be70edb13bc87353a69a13f17994ea41a5..7cfd628d8e1c576115cb934e72138535fb7d2db3 100644 (file)
@@ -200,7 +200,7 @@ static int unpack_trees_rec(struct tree_entry_list **posns, int len,
 
                        any_files = 1;
 
-                       memcpy(ce->sha1, posns[i]->sha1, 20);
+                       hashcpy(ce->sha1, posns[i]->sha1);
                        src[i + o->merge] = ce;
                        subposns[i] = df_conflict_list;
                        posns[i] = posns[i]->next;
@@ -278,7 +278,7 @@ static void unlink_entry(char *name)
        }
 }
 
-static volatile int progress_update = 0;
+static volatile sig_atomic_t progress_update;
 
 static void progress_interval(int signum)
 {
@@ -417,7 +417,7 @@ static int same(struct cache_entry *a, struct cache_entry *b)
        if (!a && !b)
                return 1;
        return a->ce_mode == b->ce_mode &&
-               !memcmp(a->sha1, b->sha1, 20);
+              !hashcmp(a->sha1, b->sha1);
 }
 
 
@@ -642,7 +642,7 @@ int threeway_merge(struct cache_entry **stages,
                    (remote_deleted && head && head_match)) {
                        if (index)
                                return deleted_entry(index, index, o);
-                       else if (path)
+                       else if (path && !head_deleted)
                                verify_absent(path, "removed", o);
                        return 0;
                }
@@ -661,8 +661,6 @@ int threeway_merge(struct cache_entry **stages,
        if (index) {
                verify_uptodate(index, o);
        }
-       else if (path)
-               verify_absent(path, "overwritten", o);
 
        o->nontrivial_merge = 1;