connect.c: mark more strings for translation
[gitweb.git] / t / t6042-merge-rename-corner-cases.sh
index b76da8fcdfa479b7689816b086d3835f53f960e0..1cbd946fc2eb9ab3dcad83c811abb6d18448fc4e 100755 (executable)
@@ -38,7 +38,7 @@ test_expect_success "Does git preserve Gollum's precious artifact?" '
                test_must_fail git merge -s recursive rename-the-ring &&
 
                # Make sure git did not delete an untracked file
-               test -f ring
+               test_path_is_file ring
        )
 '
 
@@ -80,8 +80,11 @@ test_expect_failure 'rename/modify/add-source conflict resolvable' '
 
                git merge -s recursive C^0 &&
 
-               test $(git rev-parse B:a) = $(git rev-parse b) &&
-               test $(git rev-parse C:a) = $(git rev-parse a)
+               git rev-parse >expect \
+                       B:a   C:a     &&
+               git rev-parse >actual \
+                       b     c       &&
+               test_cmp expect actual
        )
 '
 
@@ -124,8 +127,11 @@ test_expect_failure 'conflict caused if rename not detected' '
                test_line_count = 1 out &&
 
                test_line_count = 6 c &&
-               test $(git rev-parse HEAD:a) = $(git rev-parse B:a) &&
-               test $(git rev-parse HEAD:b) = $(git rev-parse A:b)
+               git rev-parse >expect \
+                       B:a   A:b     &&
+               git rev-parse >actual \
+                       :0:a  :0:b    &&
+               test_cmp expect actual
        )
 '
 
@@ -213,11 +219,14 @@ test_expect_failure 'detect rename/add-source and preserve all data' '
                git ls-files -o >out &&
                test_line_count = 1 out &&
 
-               test -f a &&
-               test -f b &&
+               test_path_is_file a &&
+               test_path_is_file b &&
 
-               test $(git rev-parse HEAD:b) = $(git rev-parse A:a) &&
-               test $(git rev-parse HEAD:a) = $(git rev-parse C:a)
+               git rev-parse >expect \
+                       A:a   C:a     &&
+               git rev-parse >actual \
+                       :0:b  :0:a    &&
+               test_cmp expect actual
        )
 '
 
@@ -236,11 +245,14 @@ test_expect_failure 'detect rename/add-source and preserve all data, merge other
                git ls-files -o >out &&
                test_line_count = 1 out &&
 
-               test -f a &&
-               test -f b &&
+               test_path_is_file a &&
+               test_path_is_file b &&
 
-               test $(git rev-parse HEAD:b) = $(git rev-parse A:a) &&
-               test $(git rev-parse HEAD:a) = $(git rev-parse C:a)
+               git rev-parse >expect \
+                       A:a   C:a     &&
+               git rev-parse >actual \
+                       :0:b  :0:a    &&
+               test_cmp expect actual
        )
 '
 
@@ -302,8 +314,8 @@ test_expect_success 'rename/directory conflict + clean content merge' '
 
                test $(git rev-parse :2:newfile) = $(git hash-object expect) &&
 
-               test -f newfile/realfile &&
-               test -f newfile~HEAD
+               test_path_is_file newfile/realfile &&
+               test_path_is_file newfile~HEAD
        )
 '
 
@@ -336,12 +348,14 @@ test_expect_success 'rename/directory conflict + content merge conflict' '
                        left base right &&
                test_cmp left newfile~HEAD &&
 
-               test $(git rev-parse :1:newfile) = $(git rev-parse base:file) &&
-               test $(git rev-parse :2:newfile) = $(git rev-parse left-conflict:newfile) &&
-               test $(git rev-parse :3:newfile) = $(git rev-parse right:file) &&
+               git rev-parse >expect                                 \
+                       base:file   left-conflict:newfile  right:file &&
+               git rev-parse >actual                                 \
+                       :1:newfile  :2:newfile             :3:newfile &&
+               test_cmp expect actual
 
-               test -f newfile/realfile &&
-               test -f newfile~HEAD
+               test_path_is_file newfile/realfile &&
+               test_path_is_file newfile~HEAD
        )
 '
 
@@ -394,7 +408,7 @@ test_expect_success 'disappearing dir in rename/directory conflict handled' '
                echo 7 >>expect &&
                test_cmp expect sub &&
 
-               test -f sub
+               test_path_is_file sub
        )
 '
 
@@ -453,13 +467,16 @@ test_expect_success 'handle rename/rename (2to1) conflict correctly' '
                git ls-files -o >out &&
                test_line_count = 3 out &&
 
-               test ! -f a &&
-               test ! -f b &&
-               test -f c~HEAD &&
-               test -f c~C^0 &&
+               test_path_is_missing a &&
+               test_path_is_missing b &&
+               test_path_is_file c~HEAD &&
+               test_path_is_file c~C^0 &&
 
-               test $(git hash-object c~HEAD) = $(git rev-parse C:a) &&
-               test $(git hash-object c~C^0) = $(git rev-parse B:b)
+               git rev-parse >expect   \
+                       C:a     B:b     &&
+               git hash-object >actual \
+                       c~HEAD  c~C^0   &&
+               test_cmp expect actual
        )
 '
 
@@ -505,13 +522,15 @@ test_expect_success 'merge has correct working tree contents' '
                git ls-files -o >out &&
                test_line_count = 1 out &&
 
-               test $(git rev-parse :1:a) = $(git rev-parse A:a) &&
-               test $(git rev-parse :3:b) = $(git rev-parse A:a) &&
-               test $(git rev-parse :2:c) = $(git rev-parse A:a) &&
-
-               test ! -f a &&
-               test $(git hash-object b) = $(git rev-parse A:a) &&
-               test $(git hash-object c) = $(git rev-parse A:a)
+               test_path_is_missing a &&
+               git rev-parse >expect   \
+                       A:a   A:a   A:a \
+                       A:a   A:a       &&
+               git rev-parse >actual    \
+                       :1:a  :3:b  :2:c &&
+               git hash-object >>actual \
+                       b     c          &&
+               test_cmp expect actual
        )
 '
 
@@ -557,14 +576,15 @@ test_expect_failure 'detect conflict with rename/rename(1to2)/add-source merge'
                git ls-files -o >out &&
                test_line_count = 1 out &&
 
-               test $(git rev-parse 3:a) = $(git rev-parse C:a) &&
-               test $(git rev-parse 1:a) = $(git rev-parse A:a) &&
-               test $(git rev-parse 2:b) = $(git rev-parse B:b) &&
-               test $(git rev-parse 3:c) = $(git rev-parse C:c) &&
+               git rev-parse >expect         \
+                       C:a   A:a   B:b   C:C &&
+               git rev-parse >actual          \
+                       :3:a  :1:a  :2:b  :3:c &&
+               test_cmp expect actual
 
-               test -f a &&
-               test -f b &&
-               test -f c
+               test_path_is_file a &&
+               test_path_is_file b &&
+               test_path_is_file c
        )
 '
 
@@ -605,8 +625,11 @@ test_expect_failure 'rename/rename/add-source still tracks new a file' '
                git ls-files -o >out &&
                test_line_count = 1 out &&
 
-               test $(git rev-parse HEAD:a) = $(git rev-parse C:a) &&
-               test $(git rev-parse HEAD:b) = $(git rev-parse A:a)
+               git rev-parse >expect \
+                       C:a   A:a     &&
+               git rev-parse >actual \
+                       :0:a  :0:b    &&
+               test_cmp expect actual
        )
 '
 
@@ -653,19 +676,20 @@ test_expect_success 'rename/rename/add-dest merge still knows about conflicting
                git ls-files -o >out &&
                test_line_count = 5 out &&
 
-               test $(git rev-parse :1:a) = $(git rev-parse A:a) &&
-               test $(git rev-parse :2:b) = $(git rev-parse C:b) &&
-               test $(git rev-parse :3:b) = $(git rev-parse B:b) &&
-               test $(git rev-parse :2:c) = $(git rev-parse C:c) &&
-               test $(git rev-parse :3:c) = $(git rev-parse B:c) &&
+               git rev-parse >expect               \
+                       A:a   C:b   B:b   C:c   B:c &&
+               git rev-parse >actual                \
+                       :1:a  :2:b  :3:b  :2:c  :3:c &&
+               test_cmp expect actual
 
-               test $(git hash-object c~HEAD) = $(git rev-parse C:c) &&
-               test $(git hash-object c~B\^0) = $(git rev-parse B:c) &&
-               test $(git hash-object b~HEAD) = $(git rev-parse C:b) &&
-               test $(git hash-object b~B\^0) = $(git rev-parse B:b) &&
+               git rev-parse >expect               \
+                       C:c     B:c     C:b     B:b &&
+               git hash-object >actual                \
+                       c~HEAD  c~B\^0  b~HEAD  b~B\^0 &&
+               test_cmp expect actual
 
-               test ! -f b &&
-               test ! -f c
+               test_path_is_missing b &&
+               test_path_is_missing c
        )
 '