]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-diff.c
Rename dirlink to gitlink.
[ps-cgit] / ui-diff.c
index 3ed0a465b378e877c21bb21856cac94d827a6c74..4695e3a6442cb1b7bc1e2bbc75291e066d24a013 100644 (file)
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -37,8 +37,7 @@ static void header(unsigned char *sha1, char *path1, int mode1,
        char *abbrev1, *abbrev2;
        int subproject;
 
        char *abbrev1, *abbrev2;
        int subproject;
 
-       subproject = (S_ISDIRLNK(mode1) || S_ISDIRLNK(mode2));
-       html("<tr><td>");
+       subproject = (S_ISGITLINK(mode1) || S_ISGITLINK(mode2));
        html("<div class='head'>");
        html("diff --git a/");
        html_txt(path1);
        html("<div class='head'>");
        html("diff --git a/");
        html_txt(path1);
@@ -79,10 +78,10 @@ static void filepair_cb(struct diff_filepair *pair)
 {
        header(pair->one->sha1, pair->one->path, pair->one->mode,
               pair->two->sha1, pair->two->path, pair->two->mode);
 {
        header(pair->one->sha1, pair->one->path, pair->one->mode,
               pair->two->sha1, pair->two->path, pair->two->mode);
-       if (S_ISDIRLNK(pair->one->mode) || S_ISDIRLNK(pair->two->mode)) {
-               if (S_ISDIRLNK(pair->one->mode))
+       if (S_ISGITLINK(pair->one->mode) || S_ISGITLINK(pair->two->mode)) {
+               if (S_ISGITLINK(pair->one->mode))
                        print_line(fmt("-Subproject %s", sha1_to_hex(pair->one->sha1)), 52);
                        print_line(fmt("-Subproject %s", sha1_to_hex(pair->one->sha1)), 52);
-               if (S_ISDIRLNK(pair->two->mode))
+               if (S_ISGITLINK(pair->two->mode))
                        print_line(fmt("+Subproject %s", sha1_to_hex(pair->two->sha1)), 52);
                return;
        }
                        print_line(fmt("+Subproject %s", sha1_to_hex(pair->two->sha1)), 52);
                return;
        }
@@ -102,8 +101,10 @@ void cgit_print_diff(const char *head, const char *old_hex, const char *new_hex,
                commit = lookup_commit_reference(sha1);
                if (commit && !parse_commit(commit)) {
                        html("<table class='diff'>");
                commit = lookup_commit_reference(sha1);
                if (commit && !parse_commit(commit)) {
                        html("<table class='diff'>");
+                       html("<tr><td>");
                        cgit_diff_commit(commit, filepair_cb);
                        cgit_diff_commit(commit, filepair_cb);
-                       html("</td></tr></table>");
+                       html("</td></tr>");
+                       html("</table>");
                }
                return;
        }
                }
                return;
        }
@@ -127,7 +128,7 @@ void cgit_print_diff(const char *head, const char *old_hex, const char *new_hex,
                header(sha1, path, 0644, sha2, path, 0644);
                if (cgit_diff_files(sha1, sha2, print_line))
                        cgit_print_error("Error running diff");
                header(sha1, path, 0644, sha2, path, 0644);
                if (cgit_diff_files(sha1, sha2, print_line))
                        cgit_print_error("Error running diff");
-               html("</tr></td>");
+               html("</td></tr>");
                break;
        case OBJ_TREE:
                cgit_diff_tree(sha1, sha2, filepair_cb);
                break;
        case OBJ_TREE:
                cgit_diff_tree(sha1, sha2, filepair_cb);
@@ -137,5 +138,5 @@ void cgit_print_diff(const char *head, const char *old_hex, const char *new_hex,
                                     typename(type)));
                break;
        }
                                     typename(type)));
                break;
        }
-       html("</td></tr></table>");
+       html("</table>");
 }
 }