diff options
-rw-r--r-- | Makefile | 2 | ||||
-rwxr-xr-x | git-rename-script | 7 |
2 files changed, 8 insertions, 1 deletions
@@ -37,7 +37,7 @@ SCRIPTS=git git-apply-patch-script git-merge-one-file-script git-prune-script \ gitk git-cherry git-rebase-script git-relink-script git-repack-script \ git-format-patch-script git-sh-setup-script git-push-script \ git-branch-script git-parse-remote git-verify-tag-script \ - git-ls-remote-script git-clone-dumb-http + git-ls-remote-script git-clone-dumb-http git-rename-script PROG= git-update-cache git-diff-files git-init-db git-write-tree \ git-read-tree git-commit-tree git-cat-file git-fsck-cache \ diff --git a/git-rename-script b/git-rename-script new file mode 100755 index 0000000000..3952382dbc --- /dev/null +++ b/git-rename-script @@ -0,0 +1,7 @@ +#!/bin/sh + +. git-sh-setup-script || die "Not a git archive" + +[ -f "$1" ] || [ -h "$1" ] || die "git rename: bad source" +[ -e "$2" ] && die "git rename: destination already exists" +mv -- "$1" "$2" && git-update-cache --add --remove -- "$1" "$2" |