author | Junio C Hamano <gitster@pobox.com> | |
Mon, 12 Nov 2007 08:14:15 +0000 (00:14 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 12 Nov 2007 08:14:15 +0000 (00:14 -0800) |
* 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
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
index 5e81aa4ee15af50bd47aa9b26ffd566328f3c35e..5ce905de862253aa2bd2ed619819306165e978f0 100644 (file)
'--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 e909e66bedb168b7d10f6f0c3cd806d6ce139a2c..bfde2e2bbeffaed68b369b25cfe1b5ef4b108e12 100644 (file)
--- 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 dd93e320a7c0d20e8eec1c171c9c96a32ced406b..1e244975abe1b41f10a784dc1e7869ee38efbfc3 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
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 e5c88c278fe23eefbf4cb4dd0c66251b208e48bd..4ef58e7ec01ebdfc6f036ccafaf837b2b38ed7a5 100644 (file)
--- a/list-objects.c
+++ b/list-objects.c
}
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;
+ }
}
index 7eff4cdc05635c85c354c9b2a96fe4844c682621..d59acc8d1ade041d01d5a45aa993b26919a0170c 100755 (executable)
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