summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-10-19 05:18:55 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-10-19 05:18:55 (GMT)
commitf5bf6feb05b8c89c448ded6e6fad0eb58ef35463 (patch)
tree9f166b46e5005a38d0aeb59a9b4880b508578688
parentd7e56dbc4f60f6bd238e8612783541d89f006fb7 (diff)
parentbbaf63f2f18242484868d6c03d5df9bd071d6deb (diff)
downloadgit-f5bf6feb05b8c89c448ded6e6fad0eb58ef35463.zip
git-f5bf6feb05b8c89c448ded6e6fad0eb58ef35463.tar.gz
git-f5bf6feb05b8c89c448ded6e6fad0eb58ef35463.tar.bz2
Merge branch 'maint'
* maint: Further 1.5.3.5 fixes described in release notes Avoid invoking diff drivers during git-stash attr: fix segfault in gitattributes parsing code Define NI_MAXSERV if not defined by operating system Ensure we add directories in the correct order Avoid scary errors about tagged trees/blobs during git-fetch
-rw-r--r--Documentation/RelNotes-1.5.3.5.txt16
-rw-r--r--attr.c5
-rw-r--r--builtin-fetch--tool.c2
-rw-r--r--daemon.c4
-rwxr-xr-xgit-cvsexportcommit.perl11
-rwxr-xr-xgit-stash.sh6
-rwxr-xr-xt/t0020-crlf.sh7
7 files changed, 43 insertions, 8 deletions
diff --git a/Documentation/RelNotes-1.5.3.5.txt b/Documentation/RelNotes-1.5.3.5.txt
index 78df418..49e5226 100644
--- a/Documentation/RelNotes-1.5.3.5.txt
+++ b/Documentation/RelNotes-1.5.3.5.txt
@@ -20,9 +20,9 @@ Fixes since v1.5.3.4
* "git-add -i" did not handle single line hunks correctly.
- * "git-rebase -i" failed if external diff drivers were used for one
- or more files in a commit. It now avoids calling the external
- diff drivers.
+ * "git-rebase -i" and "git-stash apply" failed if external diff
+ drivers were used for one or more files in a commit. They now
+ avoid calling the external diff drivers.
* "git-log --follow" did not work unless diff generation (e.g. -p)
was also requested.
@@ -38,6 +38,16 @@ Fixes since v1.5.3.4
* "git-instaweb" no longer fails on Mac OS X.
+ * "git-cvsexportcommit" didn't always create new parent directories
+ before trying to create new child directories. Fixed.
+
+ * "git-fetch" printed a scary (but bogus) error message while
+ fetching a tag that pointed to a tree or blob. The error did
+ not impact correctness, only user perception. The bogus error
+ is no longer printed.
+
+ * Git segfaulted when reading an invalid .gitattributes file. Fixed.
+
* post-receive-email example hook fixed was fixed for
non-fast-forward updates.
diff --git a/attr.c b/attr.c
index 92704a3..741db3b 100644
--- a/attr.c
+++ b/attr.c
@@ -209,8 +209,11 @@ static struct match_attr *parse_attr_line(const char *line, const char *src,
num_attr = 0;
cp = name + namelen;
cp = cp + strspn(cp, blank);
- while (*cp)
+ while (*cp) {
cp = parse_attr(src, lineno, cp, &num_attr, res);
+ if (!cp)
+ return NULL;
+ }
if (pass)
break;
res = xcalloc(1,
diff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c
index 1e43d79..e26817d 100644
--- a/builtin-fetch--tool.c
+++ b/builtin-fetch--tool.c
@@ -131,7 +131,7 @@ static int append_fetch_head(FILE *fp,
if (get_sha1(head, sha1))
return error("Not a valid object name: %s", head);
- commit = lookup_commit_reference(sha1);
+ commit = lookup_commit_reference_gently(sha1, 1);
if (!commit)
not_for_merge = 1;
diff --git a/daemon.c b/daemon.c
index 9cf22fe..660e155 100644
--- a/daemon.c
+++ b/daemon.c
@@ -9,6 +9,10 @@
#define HOST_NAME_MAX 256
#endif
+#ifndef NI_MAXSERV
+#define NI_MAXSERV 32
+#endif
+
static int log_syslog;
static int verbose;
static int reuseaddr;
diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index 7a955d4..f284c88 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -219,6 +219,17 @@ print "Applying\n";
print "Patch applied successfully. Adding new files and directories to CVS\n";
my $dirtypatch = 0;
+
+#
+# We have to add the directories in order otherwise we will have
+# problems when we try and add the sub-directory of a directory we
+# have not added yet.
+#
+# Luckily this is easy to deal with by sorting the directories and
+# dealing with the shortest ones first.
+#
+@dirs = sort { length $a <=> length $b} @dirs;
+
foreach my $d (@dirs) {
if (system(@cvs,'add',$d)) {
$dirtypatch = 1;
diff --git a/git-stash.sh b/git-stash.sh
index 7ba6162..def3163 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -110,7 +110,7 @@ show_stash () {
w_commit=$(git rev-parse --verify "$s") &&
b_commit=$(git rev-parse --verify "$s^") &&
- git diff $flags $b_commit $w_commit
+ git diff-tree $flags $b_commit $w_commit
}
apply_stash () {
@@ -139,7 +139,7 @@ apply_stash () {
unstashed_index_tree=
if test -n "$unstash_index" && test "$b_tree" != "$i_tree"
then
- git diff --binary $s^2^..$s^2 | git apply --cached
+ git diff-tree --binary $s^2^..$s^2 | git apply --cached
test $? -ne 0 &&
die 'Conflicts in index. Try without --index.'
unstashed_index_tree=$(git-write-tree) ||
@@ -162,7 +162,7 @@ apply_stash () {
git read-tree "$unstashed_index_tree"
else
a="$TMP-added" &&
- git diff --cached --name-only --diff-filter=A $c_tree >"$a" &&
+ git diff-index --cached --name-only --diff-filter=A $c_tree >"$a" &&
git read-tree --reset $c_tree &&
git update-index --add --stdin <"$a" ||
die "Cannot unstage modified files"
diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh
index 0807d9f..62bc4bb 100755
--- a/t/t0020-crlf.sh
+++ b/t/t0020-crlf.sh
@@ -371,4 +371,11 @@ test_expect_success 'in-tree .gitattributes (4)' '
}
'
+test_expect_success 'invalid .gitattributes (must not crash)' '
+
+ echo "three +crlf" >>.gitattributes &&
+ git diff
+
+'
+
test_done