hashmap: add string interning API
[gitweb.git] / t / t1400-update-ref.sh
index 48ccc4d6355c1f1a1de2080fafc31eb38836a400..0218e96366ddd8659d5a78b42ffcfd415013114c 100755 (executable)
@@ -235,7 +235,7 @@ test_expect_success \
        'rm -f o e &&
         git rev-parse --verify "master@{2005-05-26 23:33:01}" >o 2>e &&
         test '"$B"' = $(cat o) &&
-        test "warning: Log .git/logs/'"$m has gap after $gd"'." = "$(cat e)"'
+        test "warning: Log for ref '"$m has gap after $gd"'." = "$(cat e)"'
 test_expect_success \
        'Query "master@{2005-05-26 23:38:00}" (middle of history)' \
        'rm -f o e &&
@@ -253,7 +253,7 @@ test_expect_success \
        'rm -f o e &&
         git rev-parse --verify "master@{2005-05-28}" >o 2>e &&
         test '"$D"' = $(cat o) &&
-        test "warning: Log .git/logs/'"$m unexpectedly ended on $ld"'." = "$(cat e)"'
+        test "warning: Log for ref '"$m unexpectedly ended on $ld"'." = "$(cat e)"'
 
 
 rm -f .git/$m .git/logs/$m expect
@@ -858,7 +858,18 @@ test_expect_success 'stdin -z update ref fails with bad old value' '
        test_must_fail git rev-parse --verify -q $c
 '
 
+test_expect_success 'stdin -z create ref fails when ref exists' '
+       git update-ref $c $m &&
+       git rev-parse "$c" >expect &&
+       printf $F "create $c" "$m~1" >stdin &&
+       test_must_fail git update-ref -z --stdin <stdin 2>err &&
+       grep "fatal: Cannot lock the ref '"'"'$c'"'"'" err &&
+       git rev-parse "$c" >actual &&
+       test_cmp expect actual
+'
+
 test_expect_success 'stdin -z create ref fails with bad new value' '
+       git update-ref -d "$c" &&
        printf $F "create $c" "does-not-exist" >stdin &&
        test_must_fail git update-ref -z --stdin <stdin 2>err &&
        grep "fatal: create $c: invalid <newvalue>: does-not-exist" err &&