]> 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 7273a7a0b648cc8cbd6dce2043a6e544b87d28b6..aae8e7accc1ff955bd76c62b379b37f343f61cc4 100644 (file)
@@ -38,6 +38,10 @@ 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 (lstat(path, &st))
@@ -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];
                        /*