Code

Merge updated git-gui and gitk that call each other
[git.git] / t / t1400-update-ref.sh
index f387d46f1a17ac9f9d3319c4da7e30a6c6326c67..04c2b164bcba0bdead45a50bbb14ceff19e8411f 100755 (executable)
@@ -76,7 +76,7 @@ test_expect_success "delete $m (by HEAD)" '
 rm -f .git/$m
 
 test_expect_success '(not) create HEAD with old sha1' "
-       ! git update-ref HEAD $A $B
+       test_must_fail git update-ref HEAD $A $B
 "
 test_expect_success "(not) prior created .git/$m" "
        ! test -f .git/$m
@@ -87,7 +87,7 @@ test_expect_success \
        "create HEAD" \
        "git update-ref HEAD $A"
 test_expect_success '(not) change HEAD with wrong SHA1' "
-       ! git update-ref HEAD $B $Z
+       test_must_fail git update-ref HEAD $B $Z
 "
 test_expect_success "(not) changed .git/$m" "
        ! test $B"' = $(cat .git/'"$m"')
@@ -155,7 +155,8 @@ rm -f .git/$m .git/logs/$m expect
 
 git update-ref $m $D
 cat >.git/logs/$m <<EOF
-$C $A $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150320 -0500
+0000000000000000000000000000000000000000 $C $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150320 -0500
+$C $A $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150350 -0500
 $A $B $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150380 -0500
 $F $Z $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150680 -0500
 $Z $E $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150980 -0500
@@ -186,6 +187,12 @@ test_expect_success \
        'Query "master@{May 26 2005 23:32:00}" (exactly history start)' \
        'rm -f o e
         git rev-parse --verify "master@{May 26 2005 23:32:00}" >o 2>e &&
+        test '"$C"' = $(cat o) &&
+        test "" = "$(cat e)"'
+test_expect_success \
+       'Query "master@{May 26 2005 23:32:30}" (first non-creation change)' \
+       'rm -f o e
+        git rev-parse --verify "master@{May 26 2005 23:32:30}" >o 2>e &&
         test '"$A"' = $(cat o) &&
         test "" = "$(cat e)"'
 test_expect_success \
@@ -221,21 +228,21 @@ test_expect_success \
     'echo TEST >F &&
      git add F &&
         GIT_AUTHOR_DATE="2005-05-26 23:30" \
-        GIT_COMMITTER_DATE="2005-05-26 23:30" git-commit -m add -a &&
+        GIT_COMMITTER_DATE="2005-05-26 23:30" git commit -m add -a &&
         h_TEST=$(git rev-parse --verify HEAD)
         echo The other day this did not work. >M &&
         echo And then Bob told me how to fix it. >>M &&
         echo OTHER >F &&
         GIT_AUTHOR_DATE="2005-05-26 23:41" \
-        GIT_COMMITTER_DATE="2005-05-26 23:41" git-commit -F M -a &&
+        GIT_COMMITTER_DATE="2005-05-26 23:41" git commit -F M -a &&
         h_OTHER=$(git rev-parse --verify HEAD) &&
         GIT_AUTHOR_DATE="2005-05-26 23:44" \
-        GIT_COMMITTER_DATE="2005-05-26 23:44" git-commit --amend &&
+        GIT_COMMITTER_DATE="2005-05-26 23:44" git commit --amend &&
         h_FIXED=$(git rev-parse --verify HEAD) &&
         echo Merged initial commit and a later commit. >M &&
         echo $h_TEST >.git/MERGE_HEAD &&
         GIT_AUTHOR_DATE="2005-05-26 23:45" \
-        GIT_COMMITTER_DATE="2005-05-26 23:45" git-commit -F M &&
+        GIT_COMMITTER_DATE="2005-05-26 23:45" git commit -F M &&
         h_MERGED=$(git rev-parse --verify HEAD) &&
         rm -f M'
 
@@ -246,7 +253,7 @@ $h_OTHER $h_FIXED $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117151040 +0000       co
 $h_FIXED $h_MERGED $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117151100 +0000 commit (merge): Merged initial commit and a later commit.
 EOF
 test_expect_success \
-       'git-commit logged updates' \
+       'git commit logged updates' \
        "diff expect .git/logs/$m"
 unset h_TEST h_OTHER h_FIXED h_MERGED