summaryrefslogtreecommitdiff
path: root/builtin-mv.c
AgeCommit message (Collapse)Author
2006-08-16[PATCH] git-mv: add more path normalizationJohannes Schindelin
We already use the normalization from get_pathspec(), but now we also remove a trailing slash. So, git mv some_path/ into_some_path/ works now. Also, move the "can not move directory into itself" test before the subdirectory expansion. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-16git-mv: succeed even if source is a prefix of destinationJohannes Schindelin
As noted by Fredrik Kuivinen, without this patch, git-mv fails on git-mv README README-renamed because "README" is a prefix of "README-renamed". Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-13Better error message when we are unable to lock the index fileJunio C Hamano
Most of the callers except the one in refs.c use the function to update the index file. Among the index writers, everybody except write-tree dies if they cannot open it for writing. This gives the function an extra argument, to tell it to die when it cannot create a new file as the lockfile. The only caller that does not have to die is write-tree, because updating the index for the cache-tree part is optional and not being able to do so does not affect the correctness. I think we do not have to be so careful and make the failure into die() the same way as other callers, but that would be a different patch. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-08builtin-mv: fix use of uninitialized memory.Junio C Hamano
Juergen Ruehle noticed that add_slash() tries to strcat() into uninitialized memory and fails. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-04Further clean-up: usage() vs die()Junio C Hamano
This hopefully finishes the clean-up Ramsay started with recent commit 15e593e4d37d1d350fef20ab666d58f6881c7f5f and commit 8cdf33643dc0b21d9ea922a3fdd7f64226c421aa. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-29Merge branch 'lt/setup' into __/setup-n-mvJunio C Hamano
This merges the new built-in calling convention code into Johannes's builtin-mv topic in order to resolve their conflicts early on. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-26builtin git-mv: support moving directoriesJohannes Schindelin
This fixes the builtin mv for the test which Josef provided, and also fixes moving directories into existing directories, as noted by Jon Smirl. In case the destination exists, fail early (this cannot be overridden by -f). Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-26Make git-mv a builtinJohannes Schindelin
This also moves add_file_to_index() to read-cache.c. Oh, and while touching builtin-add.c, it also removes a duplicate git_config() call. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>