Skip to content

Commit

Permalink
rename_ref(): only print a warning when config-file update fails
Browse files Browse the repository at this point in the history
If git_config_rename_section() fails, rename_ref() used to return 1, which
left HEAD pointing to an absent refs/heads file (since the actual renaming
had already occurred).

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Lars Hjemli authored and Junio C Hamano committed Apr 6, 2007
1 parent 08b984f commit d26f9fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ int rename_ref(const char *oldref, const char *newref, const char *logmsg)
snprintf(oldsection, 1024, "branch.%s", oldref + 11);
snprintf(newsection, 1024, "branch.%s", newref + 11);
if (git_config_rename_section(oldsection, newsection) < 0)
return 1;
error("unable to update config-file");
}

return 0;
Expand Down

0 comments on commit d26f9fe

Please sign in to comment.