summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--read-cache.c6
-rwxr-xr-xt/t3905-stash-include-untracked.sh2
2 files changed, 4 insertions, 4 deletions
diff --git a/read-cache.c b/read-cache.c
index c823580fb0..42d804f962 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -854,7 +854,7 @@ static enum verify_path_result verify_path_internal(const char *, unsigned);
int verify_path(const char *path, unsigned mode)
{
- return verify_path_internal(path, mode) != PATH_INVALID;
+ return verify_path_internal(path, mode) == PATH_OK;
}
struct cache_entry *make_cache_entry(struct index_state *istate,
@@ -867,7 +867,7 @@ struct cache_entry *make_cache_entry(struct index_state *istate,
struct cache_entry *ce, *ret;
int len;
- if (!verify_path(path, mode)) {
+ if (verify_path_internal(path, mode) == PATH_INVALID) {
error(_("invalid path '%s'"), path);
return NULL;
}
@@ -1356,7 +1356,7 @@ static int add_index_entry_with_check(struct index_state *istate, struct cache_e
if (!ok_to_add)
return -1;
- if (!verify_path(ce->name, ce->ce_mode))
+ if (verify_path_internal(ce->name, ce->ce_mode) == PATH_INVALID)
return error(_("invalid path '%s'"), ce->name);
if (!skip_df_check &&
diff --git a/t/t3905-stash-include-untracked.sh b/t/t3905-stash-include-untracked.sh
index f213c7327e..c59bcffabb 100755
--- a/t/t3905-stash-include-untracked.sh
+++ b/t/t3905-stash-include-untracked.sh
@@ -405,7 +405,7 @@ test_expect_success 'stash show --include-untracked errors on duplicate files' '
test_i18ngrep "worktree and untracked commit have duplicate entries: tracked" err
'
-test_expect_failure 'stash -u ignores sub-repository' '
+test_expect_success 'stash -u ignores sub-repository' '
test_when_finished "rm -rf sub-repo" &&
git init sub-repo &&
git stash -u