]> git.ipfire.org Git - thirdparty/git.git/blobdiff - diff-no-index.c
fast-import: introduce "feature notes" command
[thirdparty/git.git] / diff-no-index.c
index a3e47a76e401a1b98891b15a406b5806a294af3d..aae8e7accc1ff955bd76c62b379b37f343f61cc4 100644 (file)
@@ -38,9 +38,13 @@ static int get_mode(const char *path, int *mode)
 
        if (!path || !strcmp(path, "/dev/null"))
                *mode = 0;
+#ifdef _WIN32
+       else if (!strcasecmp(path, "nul"))
+               *mode = 0;
+#endif
        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;
@@ -197,8 +201,8 @@ void diff_no_index(struct rev_info *revs,
                        return;
        }
        if (argc != i + 2)
-               die("git diff %s takes two paths",
-                   no_index ? "--no-index" : "[--no-index]");
+               usagef("git diff %s <path> <path>",
+                      no_index ? "--no-index" : "[--no-index]");
 
        diff_setup(&revs->diffopt);
        for (i = 1; i < argc - 2; ) {
@@ -229,7 +233,7 @@ void diff_no_index(struct rev_info *revs,
        if (prefix) {
                int len = strlen(prefix);
 
-               revs->diffopt.paths = xcalloc(2, sizeof(char*));
+               revs->diffopt.paths = xcalloc(2, sizeof(char *));
                for (i = 0; i < 2; i++) {
                        const char *p = argv[argc - 2 + i];
                        /*