aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-11-12 00:14:15 -0800
committerJunio C Hamano <gitster@pobox.com>2007-11-12 00:14:15 -0800
commit35865ca24500a0d46a012f7a55f39bf36389f7ba (patch)
tree9ffdddf391bc8de021d60c7c9b631c1882b1bf2c
parent40e2524da9f9fb2806a66a694b9aee722ea3ef0a (diff)
parent9b2a1821245c0e638f7b5e9da81118743fcc0120 (diff)
downloadgit-35865ca24500a0d46a012f7a55f39bf36389f7ba.tar.gz
git-35865ca24500a0d46a012f7a55f39bf36389f7ba.tar.xz
Merge branch 'maint'
* maint: for-each-ref: fix off by one read. git-branch: remove mention of non-existent '-b' option git-svn: prevent dcommitting if the index is dirty. Fix memory leak in traverse_commit_list
-rw-r--r--Documentation/git-branch.txt2
-rw-r--r--builtin-for-each-ref.c2
-rwxr-xr-xgit-svn.perl3
-rw-r--r--list-objects.c7
-rwxr-xr-xt/t9106-git-svn-dcommit-clobber-series.sh6
5 files changed, 18 insertions, 2 deletions
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index 5e81aa4ee..5ce905de8 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -105,7 +105,7 @@ OPTIONS
'--track' were given.
--no-track::
- When -b is given and a branch is created off a remote branch,
+ When a branch is created off a remote branch,
set up configuration so that git-pull will not retrieve data
from the remote branch, ignoring the branch.autosetupmerge
configuration variable.
diff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c
index e909e66be..bfde2e2bb 100644
--- a/builtin-for-each-ref.c
+++ b/builtin-for-each-ref.c
@@ -304,7 +304,7 @@ static const char *find_wholine(const char *who, int wholen, const char *buf, un
if (!eol)
return "";
eol++;
- if (eol[1] == '\n')
+ if (*eol == '\n')
return ""; /* end of header */
buf = eol;
}
diff --git a/git-svn.perl b/git-svn.perl
index dd93e320a..1e244975a 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -390,6 +390,9 @@ sub cmd_set_tree {
sub cmd_dcommit {
my $head = shift;
+ git_cmd_try { command_oneline(qw/diff-index --quiet HEAD/) }
+ 'Cannot dcommit with a dirty index. Commit your changes first'
+ . "or stash them with `git stash'.\n";
$head ||= 'HEAD';
my @refs;
my ($url, $rev, $uuid, $gs) = working_head_info($head, \@refs);
diff --git a/list-objects.c b/list-objects.c
index e5c88c278..4ef58e7ec 100644
--- a/list-objects.c
+++ b/list-objects.c
@@ -170,4 +170,11 @@ void traverse_commit_list(struct rev_info *revs,
}
for (i = 0; i < objects.nr; i++)
show_object(&objects.objects[i]);
+ free(objects.objects);
+ if (revs->pending.nr) {
+ free(revs->pending.objects);
+ revs->pending.nr = 0;
+ revs->pending.alloc = 0;
+ revs->pending.objects = NULL;
+ }
}
diff --git a/t/t9106-git-svn-dcommit-clobber-series.sh b/t/t9106-git-svn-dcommit-clobber-series.sh
index 7eff4cdc0..d59acc8d1 100755
--- a/t/t9106-git-svn-dcommit-clobber-series.sh
+++ b/t/t9106-git-svn-dcommit-clobber-series.sh
@@ -53,4 +53,10 @@ test_expect_success 'change file but in unrelated area' "
test x\"\`sed -n -e 61p < file\`\" = x6611
"
+test_expect_failure 'attempt to dcommit with a dirty index' '
+ echo foo >>file &&
+ git add file &&
+ git svn dcommit
+'
+
test_done