diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-07-18 16:57:47 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-07-18 16:57:47 -0700 |
commit | 58b1ef2f0fce75ebf4fbf88e5bdf76a0afaeacce (patch) | |
tree | d88020de86478eeaa883f6626ba6a2f5fdd94e95 | |
parent | Revert "mailinfo: Remove only one set of square brackets" (diff) | |
parent | checkout -f: deal with a D/F conflict entry correctly (diff) | |
download | tgif-58b1ef2f0fce75ebf4fbf88e5bdf76a0afaeacce.tar.xz |
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.c | 4 | ||||
-rw-r--r-- | sha1_name.c | 2 | ||||
-rw-r--r-- | unpack-trees.c | 2 |
3 files changed, 4 insertions, 4 deletions
@@ -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)) { |