diff options
Diffstat (limited to 'git-rename-script')
-rwxr-xr-x | git-rename-script | 7 |
1 files changed, 7 insertions, 0 deletions
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" |