aboutsummaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-10-03 15:42:48 +0900
committerJunio C Hamano <gitster@pobox.com>2017-10-03 15:42:48 +0900
commit3b48045c6c73a51834a2f83440a30225485ee431 (patch)
treeca7e9460aaadd4e6f26414c86bd72df6ab371fb8 /refs.c
parentb2a2c4d8099c69ec997e51cac489c0947ad17956 (diff)
parente5435ff1fc64d93cce73ec4ee2571219384a92a9 (diff)
downloadgit-3b48045c6c73a51834a2f83440a30225485ee431.tar.gz
git-3b48045c6c73a51834a2f83440a30225485ee431.tar.xz
Merge branch 'sd/branch-copy'
"git branch" learned "-c/-C" to create a new branch by copying an existing one. * sd/branch-copy: branch: fix "copy" to never touch HEAD branch: add a --copy (-c) option to go with --move (-m) branch: add test for -m renaming multiple config sections config: create a function to format section headers
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/refs.c b/refs.c
index 6042645c4..6cfd88ff6 100644
--- a/refs.c
+++ b/refs.c
@@ -2036,3 +2036,14 @@ int rename_ref(const char *oldref, const char *newref, const char *logmsg)
{
return refs_rename_ref(get_main_ref_store(), oldref, newref, logmsg);
}
+
+int refs_copy_existing_ref(struct ref_store *refs, const char *oldref,
+ const char *newref, const char *logmsg)
+{
+ return refs->be->copy_ref(refs, oldref, newref, logmsg);
+}
+
+int copy_existing_ref(const char *oldref, const char *newref, const char *logmsg)
+{
+ return refs_copy_existing_ref(get_main_ref_store(), oldref, newref, logmsg);
+}