rename_ref(): only print a warning when config-file update fails
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>
Lars Hjemli committed
Apr 6, 2007 at 10:33 UTC
d26f9fef470443dfb0d09c08341634208f4fb6f7
1 file changed
+1
-1
refs.c
+1
-1
@@ -835,7 +835,7 @@ int rename_ref(const char *oldref, const char *newref, const char *logmsg)
835
snprintf(oldsection, 1024, "branch.%s", oldref + 11);
836
snprintf(newsection, 1024, "branch.%s", newref + 11);
837
if (git_config_rename_section(oldsection, newsection) < 0)
838
- return 1;
838
+ error("unable to update config-file");
839
}
840
841
return 0;