summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-07-18 16:57:47 -0700
committerJunio C Hamano <gitster@pobox.com>2009-07-18 16:57:47 -0700
commit58b1ef2f0fce75ebf4fbf88e5bdf76a0afaeacce (patch)
treed88020de86478eeaa883f6626ba6a2f5fdd94e95
parent4525e8e41a8c0c4246a95097744604ea72198dad (diff)
parent78d3b06e0f5e6aaea001ee8e3e7c8e401dc4b244 (diff)
downloadgit-58b1ef2f0fce75ebf4fbf88e5bdf76a0afaeacce.tar.gz
Merge branch 'maint'
* maint: checkout -f: deal with a D/F conflict entry correctly sha1_name.c: avoid unnecessary strbuf_release refs.c: release file descriptor on error return
-rw-r--r--refs.c4
-rw-r--r--sha1_name.c2
-rw-r--r--unpack-trees.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/refs.c b/refs.c
index dffe395a97..e15880fbc8 100644
--- a/refs.c
+++ b/refs.c
@@ -1525,8 +1525,10 @@ int for_each_recent_reflog_ent(const char *ref, each_reflog_ent_fn fn, long ofs,
if (fstat(fileno(logfp), &statbuf) ||
statbuf.st_size < ofs ||
fseek(logfp, -ofs, SEEK_END) ||
- fgets(buf, sizeof(buf), logfp))
+ fgets(buf, sizeof(buf), logfp)) {
+ fclose(logfp);
return -1;
+ }
}
while (fgets(buf, sizeof(buf), logfp)) {
diff --git a/sha1_name.c b/sha1_name.c
index 904bcd96a5..44bb62d270 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -777,8 +777,6 @@ int interpret_branch_name(const char *name, struct strbuf *buf)
for_each_recent_reflog_ent("HEAD", grab_nth_branch_switch, 40960, &cb);
if (cb.cnt < nth) {
cb.cnt = 0;
- for (i = 0; i < nth; i++)
- strbuf_release(&cb.buf[i]);
for_each_reflog_ent("HEAD", grab_nth_branch_switch, &cb);
}
if (cb.cnt < nth)
diff --git a/unpack-trees.c b/unpack-trees.c
index 48d862d3b4..720f7a1616 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -999,7 +999,7 @@ int oneway_merge(struct cache_entry **src, struct unpack_trees_options *o)
return error("Cannot do a oneway merge of %d trees",
o->merge_size);
- if (!a)
+ if (!a || a == o->df_conflict_entry)
return deleted_entry(old, old, o);
if (old && same(old, a)) {