summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-11-03 15:45:36 -0800
committerJunio C Hamano <junkio@cox.net>2005-11-03 15:45:36 -0800
commit6ddc0964034342519a87fe013781abf31c6db6ad (patch)
tree74cc863556a42d41e2bf8dec45e6fd33ed312228 /t
parentGIT 0.99.9b (diff)
parentIllustration: "Commit DAG Revision Naming" (diff)
downloadgit-0.99.9c.tar.gz
git-0.99.9c.zip
GIT 0.99.9cv0.99.9c
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to '')
-rwxr-xr-xt/t3001-ls-files-others-exclude.sh12
-rw-r--r--tag.c7
-rw-r--r--tag.h2
3 files changed, 19 insertions, 2 deletions
diff --git a/t/t3001-ls-files-others-exclude.sh b/t/t3001-ls-files-others-exclude.sh
index 5beaaa3375..fde2bb25fa 100755
--- a/t/t3001-ls-files-others-exclude.sh
+++ b/t/t3001-ls-files-others-exclude.sh
@@ -67,4 +67,16 @@ test_expect_success \
>output &&
diff -u expect output'
+# Test \r\n (MSDOS-like systems)
+echo -ne '*.1\r\n/*.3\r\n!*.6\r\n' >.gitignore
+
+test_expect_success \
+ 'git-ls-files --others with \r\n line endings.' \
+ 'git-ls-files --others \
+ --exclude=\*.6 \
+ --exclude-per-directory=.gitignore \
+ --exclude-from=.git/ignore \
+ >output &&
+ diff -u expect output'
+
test_done
diff --git a/tag.c b/tag.c
index b1ab75ff01..e574c4b7a4 100644
--- a/tag.c
+++ b/tag.c
@@ -3,10 +3,15 @@
const char *tag_type = "tag";
-struct object *deref_tag(struct object *o)
+struct object *deref_tag(struct object *o, const char *warn, int warnlen)
{
while (o && o->type == tag_type)
o = parse_object(((struct tag *)o)->tagged->sha1);
+ if (!o && warn) {
+ if (!warnlen)
+ warnlen = strlen(warn);
+ error("missing object referenced by '%.*s'", warnlen, warn);
+ }
return o;
}
diff --git a/tag.h b/tag.h
index 36e532401f..7a0cb0070d 100644
--- a/tag.h
+++ b/tag.h
@@ -15,6 +15,6 @@ struct tag {
extern struct tag *lookup_tag(const unsigned char *sha1);
extern int parse_tag_buffer(struct tag *item, void *data, unsigned long size);
extern int parse_tag(struct tag *item);
-extern struct object *deref_tag(struct object *);
+extern struct object *deref_tag(struct object *, const char *, int);
#endif /* TAG_H */