aboutsummaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2007-04-06 14:13:00 +0200
committerJunio C Hamano <junkio@cox.net>2007-04-06 16:54:39 -0700
commit19eba1515a7d3b0dac6d4ee73492d978c3c2149b (patch)
tree467d51b8c8154cf6b8fcbbad40001f42ea833cb8 /refs.c
parentd26f9fef470443dfb0d09c08341634208f4fb6f7 (diff)
downloadgit-19eba1515a7d3b0dac6d4ee73492d978c3c2149b.tar.gz
git-19eba1515a7d3b0dac6d4ee73492d978c3c2149b.tar.xz
Make builtin-branch.c handle the git config file
This moves the knowledge about .git/config usage out of refs.c and into builtin-branch.c instead, which allows git-branch to update HEAD to point at the moved branch before attempting to update the config file. It also allows git-branch to exit with an error code if updating the config file should fail. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/refs.c b/refs.c
index 2ac638494..d2b7b7fb5 100644
--- a/refs.c
+++ b/refs.c
@@ -828,16 +828,6 @@ int rename_ref(const char *oldref, const char *newref, const char *logmsg)
goto rollback;
}
- if (!prefixcmp(oldref, "refs/heads/") &&
- !prefixcmp(newref, "refs/heads/")) {
- char oldsection[1024], newsection[1024];
-
- snprintf(oldsection, 1024, "branch.%s", oldref + 11);
- snprintf(newsection, 1024, "branch.%s", newref + 11);
- if (git_config_rename_section(oldsection, newsection) < 0)
- error("unable to update config-file");
- }
-
return 0;
rollback: