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
This commit is contained in:
commit
58b1ef2f0f
4
refs.c
4
refs.c
@ -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];
|
||||
|
@ -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)
|
||||
|
@ -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…
Reference in New Issue
Block a user