mv: allow renaming to fix case on case insensitive filesystems
[gitweb.git] / t / t7102-reset.sh
index 2ef96e92406406409f10788d827a1d937ce69561..ee117e2e727d2bcdc87053684f0c32486452a65e 100755 (executable)
@@ -10,14 +10,16 @@ Documented tests for git reset'
 . ./test-lib.sh
 
 commit_msg () {
-       # String "modify 2nd file (changed)" partly in German(translated with Google Translate),
+       # String "modify 2nd file (changed)" partly in German
+       # (translated with Google Translate),
        # encoded in UTF-8, used as a commit log message below.
-       msg=$(printf "modify 2nd file (ge\303\244ndert)")
+       msg="modify 2nd file (ge\303\244ndert)\n"
        if test -n "$1"
        then
-               msg=$(echo $msg | iconv -f utf-8 -t $1)
+               printf "$msg" | iconv -f utf-8 -t "$1"
+       else
+               printf "$msg"
        fi
-       echo $msg
 }
 
 test_expect_success 'creating initial files and commits' '
@@ -484,7 +486,7 @@ test_expect_success 'disambiguation (1)' '
        test_must_fail git diff --quiet -- secondfile &&
        test -z "$(git diff --cached --name-only)" &&
        test -f secondfile &&
-       test ! -s secondfile
+       test_must_be_empty secondfile
 
 '
 
@@ -533,4 +535,15 @@ test_expect_success 'reset with paths accepts tree' '
        git diff HEAD --exit-code
 '
 
+test_expect_success 'reset --mixed sets up work tree' '
+       git init mixed_worktree &&
+       (
+               cd mixed_worktree &&
+               test_commit dummy
+       ) &&
+       : >expect &&
+       git --git-dir=mixed_worktree/.git --work-tree=mixed_worktree reset >actual &&
+       test_cmp expect actual
+'
+
 test_done