From c976d415e5352886f0650f8e2edba81866c38587 Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Tue, 28 Nov 2006 15:47:40 +0100 Subject: git-branch: add options and tests for branch renaming Extend git-branch with the following options: git-branch -m|-M [] newbranch The -M variation is required to force renaming over an exsisting branchname. This also indroduces $GIT_DIR/RENAME_REF which is a "metabranch" used when renaming branches. It will always hold the original sha1 for the latest renamed branch. Additionally, if $GIT_DIR/logs/RENAME_REF exists, all branch rename events are logged there. Finally, some testcases are added to verify the new options. Signed-off-by: Lars Hjemli Signed-off-by: Junio C Hamano --- refs.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'refs.h') diff --git a/refs.h b/refs.h index cd1e1d620..ce73d5c7a 100644 --- a/refs.h +++ b/refs.h @@ -47,4 +47,7 @@ extern int read_ref_at(const char *ref, unsigned long at_time, int cnt, unsigned /** Returns 0 if target has the right format for a ref. **/ extern int check_ref_format(const char *target); +/** rename ref, return 0 on success **/ +extern int rename_ref(const char *oldref, const char *newref); + #endif /* REFS_H */ -- cgit v1.2.1