From: Junio C Hamano Date: Sat, 1 Dec 2018 12:41:42 +0000 (+0900) Subject: Merge branch 'ab/replace-graft-with-replace-advice' X-Git-Tag: v2.20.0-rc2~9 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/671e629d6eab689cb685fb375997c60b2cbcbab7?ds=inline;hp=-c Merge branch 'ab/replace-graft-with-replace-advice' The advice message to tell the user to migrate an existing graft file to the replace system when a graft file was read was shown even when "git replace --convert-graft-file" command, which is the way the message suggests to use, was running, which made little sense. * ab/replace-graft-with-replace-advice: advice: don't pointlessly suggest --convert-graft-file --- 671e629d6eab689cb685fb375997c60b2cbcbab7 diff --combined builtin/replace.c index a58b9c6d13,6adc4f594f..affcdfb416 --- a/builtin/replace.c +++ b/builtin/replace.c @@@ -295,7 -295,7 +295,7 @@@ static int import_object(struct object_ close(fd); return -1; } - if (index_fd(oid, fd, &st, type, NULL, flags) < 0) + if (index_fd(&the_index, oid, fd, &st, type, NULL, flags) < 0) return error(_("unable to write object to database")); /* index_fd close()s fd for us */ } @@@ -343,7 -343,7 +343,7 @@@ static int edit_and_replace(const char } free(tmpfile); - if (!oidcmp(&old_oid, &new_oid)) + if (oideq(&old_oid, &new_oid)) return error(_("new object is the same as the old one: '%s'"), oid_to_hex(&old_oid)); return replace_object_oid(object_ref, &old_oid, "replacement", &new_oid, force); @@@ -414,7 -414,7 +414,7 @@@ static int check_one_mergetag(struct co if (get_oid(mergetag_data->argv[i], &oid) < 0) return error(_("not a valid object name: '%s'"), mergetag_data->argv[i]); - if (!oidcmp(&tag->tagged->oid, &oid)) + if (oideq(&tag->tagged->oid, &oid)) return 0; /* found */ } @@@ -474,7 -474,7 +474,7 @@@ static int create_graft(int argc, cons strbuf_release(&buf); - if (!oidcmp(&old_oid, &new_oid)) { + if (oideq(&old_oid, &new_oid)) { if (gentle) { warning(_("graft for '%s' unnecessary"), oid_to_hex(&old_oid)); return 0; @@@ -495,6 -495,7 +495,7 @@@ static int convert_graft_file(int force if (!fp) return -1; + advice_graft_file_deprecated = 0; while (strbuf_getline(&buf, fp) != EOF) { if (*buf.buf == '#') continue;