git-p4: Unset P4DIFF environment variable when using 'p4 -du diff'
[gitweb.git] / setup.c
diff --git a/setup.c b/setup.c
index dc247a84c49709d2bff00440e5ac976df83acd2e..41e298b8f549dcce28fca335c5f5b7fe5aea27bb 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -202,6 +202,8 @@ const char **get_pathspec(const char *prefix, const char **pathspec)
                const char *p = prefix_path(prefix, prefixlen, *src);
                if (p)
                        *(dst++) = p;
+               else
+                       exit(128); /* error message already given */
                src++;
        }
        *dst = NULL;
@@ -448,8 +450,7 @@ int check_repository_format_version(const char *var, const char *value)
        } else if (strcmp(var, "core.worktree") == 0) {
                if (!value)
                        return config_error_nonbool(var);
-               if (git_work_tree_cfg)
-                       free(git_work_tree_cfg);
+               free(git_work_tree_cfg);
                git_work_tree_cfg = xstrdup(value);
                inside_work_tree = -1;
        }