1. Stefan Saasen
  2. git

Commits

Junio C Hamano  committed 58b1ef2 Merge

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

  • Participants
  • Parent commits 4525e8e, 78d3b06
  • Branches master

Comments (0)

Files changed (3)

File refs.c

View file
 		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)) {

File sha1_name.c

View file
 	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)

File unpack-trees.c

View file
 		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)) {