Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
replace: rename 'new' variables
author
Brandon Williams
<bmwill@google.com>
Wed, 14 Feb 2018 18:59:59 +0000
(10:59 -0800)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 22 Feb 2018 18:08:05 +0000
(10:08 -0800)
Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/replace.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
31c2c7a
)
diff --git
a/builtin/replace.c
b/builtin/replace.c
index 42cf4f62a43f21f0ffafb5460a71fa2c661f988d..303ca134dcc00131986a79c31f68dc6dcd70be0d 100644
(file)
--- a/
builtin/replace.c
+++ b/
builtin/replace.c
@@
-284,30
+284,30
@@
static int edit_and_replace(const char *object_ref, int force, int raw)
{
char *tmpfile = git_pathdup("REPLACE_EDITOBJ");
enum object_type type;
{
char *tmpfile = git_pathdup("REPLACE_EDITOBJ");
enum object_type type;
- struct object_id old
, new
, prev;
+ struct object_id old
_oid, new_oid
, prev;
struct strbuf ref = STRBUF_INIT;
struct strbuf ref = STRBUF_INIT;
- if (get_oid(object_ref, &old) < 0)
+ if (get_oid(object_ref, &old
_oid
) < 0)
die("Not a valid object name: '%s'", object_ref);
die("Not a valid object name: '%s'", object_ref);
- type = sha1_object_info(old.hash, NULL);
+ type = sha1_object_info(old
_oid
.hash, NULL);
if (type < 0)
if (type < 0)
- die("unable to get object type for %s", oid_to_hex(&old));
+ die("unable to get object type for %s", oid_to_hex(&old
_oid
));
- check_ref_valid(&old, &prev, &ref, force);
+ check_ref_valid(&old
_oid
, &prev, &ref, force);
strbuf_release(&ref);
strbuf_release(&ref);
- export_object(&old, type, raw, tmpfile);
+ export_object(&old
_oid
, type, raw, tmpfile);
if (launch_editor(tmpfile, NULL, NULL) < 0)
die("editing object file failed");
if (launch_editor(tmpfile, NULL, NULL) < 0)
die("editing object file failed");
- import_object(&new, type, raw, tmpfile);
+ import_object(&new
_oid
, type, raw, tmpfile);
free(tmpfile);
free(tmpfile);
- if (!oidcmp(&old
, &new
))
- return error("new object is the same as the old one: '%s'", oid_to_hex(&old));
+ if (!oidcmp(&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
, "replacement", &new
, force);
+ return replace_object_oid(object_ref, &old
_oid, "replacement", &new_oid
, force);
}
static void replace_parents(struct strbuf *buf, int argc, const char **argv)
}
static void replace_parents(struct strbuf *buf, int argc, const char **argv)
@@
-386,16
+386,16
@@
static void check_mergetags(struct commit *commit, int argc, const char **argv)
static int create_graft(int argc, const char **argv, int force)
{
static int create_graft(int argc, const char **argv, int force)
{
- struct object_id old
, new
;
+ struct object_id old
_oid, new_oid
;
const char *old_ref = argv[0];
struct commit *commit;
struct strbuf buf = STRBUF_INIT;
const char *buffer;
unsigned long size;
const char *old_ref = argv[0];
struct commit *commit;
struct strbuf buf = STRBUF_INIT;
const char *buffer;
unsigned long size;
- if (get_oid(old_ref, &old) < 0)
+ if (get_oid(old_ref, &old
_oid
) < 0)
die(_("Not a valid object name: '%s'"), old_ref);
die(_("Not a valid object name: '%s'"), old_ref);
- commit = lookup_commit_or_die(&old, old_ref);
+ commit = lookup_commit_or_die(&old
_oid
, old_ref);
buffer = get_commit_buffer(commit, &size);
strbuf_add(&buf, buffer, size);
buffer = get_commit_buffer(commit, &size);
strbuf_add(&buf, buffer, size);
@@
-410,15
+410,15
@@
static int create_graft(int argc, const char **argv, int force)
check_mergetags(commit, argc, argv);
check_mergetags(commit, argc, argv);
- if (write_sha1_file(buf.buf, buf.len, commit_type, new.hash))
+ if (write_sha1_file(buf.buf, buf.len, commit_type, new
_oid
.hash))
die(_("could not write replacement commit for: '%s'"), old_ref);
strbuf_release(&buf);
die(_("could not write replacement commit for: '%s'"), old_ref);
strbuf_release(&buf);
- if (!oidcmp(&old
, &new
))
- return error("new commit is the same as the old one: '%s'", oid_to_hex(&old));
+ if (!oidcmp(&old
_oid, &new_oid
))
+ return error("new commit is the same as the old one: '%s'", oid_to_hex(&old
_oid
));
- return replace_object_oid(old_ref, &old
, "replacement", &new
, force);
+ return replace_object_oid(old_ref, &old
_oid, "replacement", &new_oid
, force);
}
int cmd_replace(int argc, const char **argv, const char *prefix)
}
int cmd_replace(int argc, const char **argv, const char *prefix)