Code

contrib/difftool: Don't repeat merge tool candidates
[git.git] / diff-no-index.c
index 12ff1f1eefde8ac33709cd423a980708cd38b072..0dbd9dad8b100cdd4918571636ad3e9a1a0a2abf 100644 (file)
@@ -40,7 +40,7 @@ static int get_mode(const char *path, int *mode)
                *mode = 0;
        else if (!strcmp(path, "-"))
                *mode = create_ce_mode(0666);
-       else if (stat(path, &st))
+       else if (lstat(path, &st))
                return error("Could not access '%s'", path);
        else
                *mode = st.st_mode;
@@ -207,8 +207,10 @@ void diff_no_index(struct rev_info *revs,
                int j;
                if (!strcmp(argv[i], "--no-index"))
                        i++;
-               else if (!strcmp(argv[i], "-q"))
+               else if (!strcmp(argv[i], "-q")) {
                        options |= DIFF_SILENT_ON_REMOVED;
+                       i++;
+               }
                else if (!strcmp(argv[i], "--"))
                        i++;
                else {