summaryrefslogtreecommitdiff
path: root/src/refs.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-03-03 19:53:17 +0200
committerVicent Marti <tanoku@gmail.com>2011-03-03 20:23:51 +0200
commit19a30a3f6e15da184fc449315314af666f2082bf (patch)
treec9263fef3e6fea67f07405057777057684f9b6a0 /src/refs.c
parent6b02b215169d493abe35d8036c3cf687521e08a5 (diff)
downloadlibgit2-19a30a3f6e15da184fc449315314af666f2082bf.tar.gz
Add new move function, `gitfo_mv_force`
Forces a move by creating the folder for the destination file, if it doesn't exist. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/refs.c')
-rw-r--r--src/refs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/refs.c b/src/refs.c
index 19f5406a4..5bbc7770e 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -1183,7 +1183,7 @@ int git_reference_rename(git_reference *ref, const char *new_name)
git__joinpath(old_path, ref->owner->path_repository, old_name);
git__joinpath(new_path, ref->owner->path_repository, ref->name);
- error = gitfo_move_file(old_path, new_path);
+ error = gitfo_mv_force(old_path, new_path);
if (error < GIT_SUCCESS)
goto cleanup;
@@ -1218,7 +1218,7 @@ rename_loose_to_old_name:
git__joinpath(new_path, ref->owner->path_repository, old_name);
/* No error checking. We'll return the initial error */
- gitfo_move_file(old_path, new_path);
+ gitfo_mv_force(old_path, new_path);
/* restore the old name */
free(ref->name);