Browse Source

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
maint
Junio C Hamano 16 years ago
parent
commit
58b1ef2f0f
  1. 4
      refs.c
  2. 2
      sha1_name.c
  3. 2
      unpack-trees.c

4
refs.c

@ -1525,9 +1525,11 @@ int for_each_recent_reflog_ent(const char *ref, each_reflog_ent_fn fn, long ofs, @@ -1525,9 +1525,11 @@ 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)) {
unsigned char osha1[20], nsha1[20];

2
sha1_name.c

@ -777,8 +777,6 @@ int interpret_branch_name(const char *name, struct strbuf *buf) @@ -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)

2
unpack-trees.c

@ -999,7 +999,7 @@ int oneway_merge(struct cache_entry **src, struct unpack_trees_options *o) @@ -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)) {

Loading…
Cancel
Save