diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-10-03 15:42:48 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-10-03 15:42:48 +0900 |
commit | 3b48045c6c73a51834a2f83440a30225485ee431 (patch) | |
tree | ca7e9460aaadd4e6f26414c86bd72df6ab371fb8 /refs.c | |
parent | b2a2c4d8099c69ec997e51cac489c0947ad17956 (diff) | |
parent | e5435ff1fc64d93cce73ec4ee2571219384a92a9 (diff) | |
download | git-3b48045c6c73a51834a2f83440a30225485ee431.tar.gz |
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.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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); +} |