status: do not report errors in sequencer/todo
[gitweb.git] / builtin / replace.c
index 730a6448ae9bfdb8836d8ea704fb6cb48b4962d7..644b21ca8d57a75fa83ecbf0e58dd07a685cd9e4 100644 (file)
@@ -82,6 +82,10 @@ static int list_replace_refs(const char *pattern, const char *format)
                data.format = REPLACE_FORMAT_MEDIUM;
        else if (!strcmp(format, "long"))
                data.format = REPLACE_FORMAT_LONG;
+       /*
+        * Please update _git_replace() in git-completion.bash when
+        * you add new format
+        */
        else
                return error(_("invalid replace format '%s'\n"
                               "valid formats are 'short', 'medium' and 'long'"),
@@ -477,15 +481,18 @@ static int create_graft(int argc, const char **argv, int force, int gentle)
 
        strbuf_release(&buf);
 
-       if (oideq(&old_oid, &new_oid)) {
+       if (oideq(&commit->object.oid, &new_oid)) {
                if (gentle) {
-                       warning(_("graft for '%s' unnecessary"), oid_to_hex(&old_oid));
+                       warning(_("graft for '%s' unnecessary"),
+                               oid_to_hex(&commit->object.oid));
                        return 0;
                }
-               return error(_("new commit is the same as the old one: '%s'"), oid_to_hex(&old_oid));
+               return error(_("new commit is the same as the old one: '%s'"),
+                            oid_to_hex(&commit->object.oid));
        }
 
-       return replace_object_oid(old_ref, &old_oid, "replacement", &new_oid, force);
+       return replace_object_oid(old_ref, &commit->object.oid,
+                                 "replacement", &new_oid, force);
 }
 
 static int convert_graft_file(int force)