summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-checkout-script2
-rw-r--r--ls-files.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/git-checkout-script b/git-checkout-script
index a377407..9feff14 100755
--- a/git-checkout-script
+++ b/git-checkout-script
@@ -72,4 +72,6 @@ if [ "$?" -eq 0 ]; then
fi
[ "$branch" ] && ln -sf "refs/heads/$branch" "$GIT_DIR/HEAD"
rm -f "$GIT_DIR/MERGE_HEAD"
+else
+ exit 1
fi
diff --git a/ls-files.c b/ls-files.c
index 2c7aada..e53d245 100644
--- a/ls-files.c
+++ b/ls-files.c
@@ -496,7 +496,7 @@ static void verify_pathspec(void)
char c = n[i];
if (prev && prev[i] != c)
break;
- if (c == '*' || c == '?')
+ if (!c || c == '*' || c == '?')
break;
if (c == '/')
len = i+1;