aboutsummaryrefslogtreecommitdiff
path: root/builtin-branch.c
diff options
context:
space:
mode:
authorGerrit Pape <pape@smarden.org>2007-06-09 12:40:35 +0000
committerJunio C Hamano <gitster@pobox.com>2007-06-09 11:53:05 -0700
commitf1eccbab638df66a7d8ec881f6f695514b26f44f (patch)
tree6e0cdad8a3154bf0ec71ba4295887c4071bb364e /builtin-branch.c
parente58db03bbee4af96e60b6ac88b84c1c11b8b037e (diff)
downloadgit-f1eccbab638df66a7d8ec881f6f695514b26f44f.tar.gz
git-f1eccbab638df66a7d8ec881f6f695514b26f44f.tar.xz
git-branch: cleanup config file when deleting branches
When deleting branches, remove the sections referring to these branches from the config file. Signed-off-by: Gerrit Pape <pape@smarden.org>
Diffstat (limited to 'builtin-branch.c')
-rw-r--r--builtin-branch.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/builtin-branch.c b/builtin-branch.c
index da480519d..bd4748f84 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -85,6 +85,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
unsigned char sha1[20];
char *name = NULL;
const char *fmt, *remote;
+ char section[PATH_MAX];
int i;
int ret = 0;
@@ -152,9 +153,13 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
error("Error deleting %sbranch '%s'", remote,
argv[i]);
ret = 1;
- } else
+ } else {
printf("Deleted %sbranch %s.\n", remote, argv[i]);
-
+ snprintf(section, sizeof(section), "branch.%s",
+ argv[i]);
+ if (git_config_rename_section(section, NULL) < 0)
+ warning("Update of config-file failed");
+ }
}
if (name)