Add functions git_config_set() and git_config_set_multivar()
[git.git] / git-revert.sh
index 722c4f7..4154fe0 100755 (executable)
@@ -56,9 +56,12 @@ t)
                die "Your index file is unmerged."
        ;;
 *)
-       check_clean_tree || die "Cannot run $me from a dirty tree."
        head=$(git-rev-parse --verify HEAD) ||
                die "You do not have a valid HEAD"
+       files=$(git-diff-index --cached --name-only $head) || exit
+       if [ "$files" ]; then
+               die "Dirty index: cannot $me (dirty: $files)"
+       fi
        ;;
 esac
 
@@ -109,7 +112,7 @@ cherry-pick)
                q
        }'
        set_author_env=`git-cat-file commit "$commit" |
-       sed -ne "$pick_author_script"`
+       LANG=C LC_ALL=C sed -ne "$pick_author_script"`
        eval "$set_author_env"
        export GIT_AUTHOR_NAME
        export GIT_AUTHOR_EMAIL