reset: rename update_refs to reset_refs
The function resets refs rather than doing arbitrary updates. Rename it to allow a future general-purpose update_refs function to be added. Signed-off-by: Brad King <brad.king@kitware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
e230c568c4
commit
2be778a8ac
@ -219,7 +219,7 @@ static const char **parse_args(const char **argv, const char *prefix, const char
|
|||||||
return argv[0] ? get_pathspec(prefix, argv) : NULL;
|
return argv[0] ? get_pathspec(prefix, argv) : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int update_refs(const char *rev, const unsigned char *sha1)
|
static int reset_refs(const char *rev, const unsigned char *sha1)
|
||||||
{
|
{
|
||||||
int update_ref_status;
|
int update_ref_status;
|
||||||
struct strbuf msg = STRBUF_INIT;
|
struct strbuf msg = STRBUF_INIT;
|
||||||
@ -350,7 +350,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
|
|||||||
if (!pathspec && !unborn) {
|
if (!pathspec && !unborn) {
|
||||||
/* Any resets without paths update HEAD to the head being
|
/* Any resets without paths update HEAD to the head being
|
||||||
* switched to, saving the previous head in ORIG_HEAD before. */
|
* switched to, saving the previous head in ORIG_HEAD before. */
|
||||||
update_ref_status = update_refs(rev, sha1);
|
update_ref_status = reset_refs(rev, sha1);
|
||||||
|
|
||||||
if (reset_type == HARD && !update_ref_status && !quiet)
|
if (reset_type == HARD && !update_ref_status && !quiet)
|
||||||
print_new_head_line(lookup_commit_reference(sha1));
|
print_new_head_line(lookup_commit_reference(sha1));
|
||||||
|
Loading…
Reference in New Issue
Block a user