Merge branch 'lj/refs' into next

* lj/refs:
  ref-log: fix D/F conflict coming from deleted refs.
This commit is contained in:
Junio C Hamano
2006-10-19 01:29:20 -07:00
2 changed files with 14 additions and 2 deletions

14
refs.c
View File

@@ -733,8 +733,18 @@ static int log_ref_write(struct ref_lock *lock,
if (logfd < 0) {
if (!(oflags & O_CREAT) && errno == ENOENT)
return 0;
return error("Unable to append to %s: %s",
lock->log_file, strerror(errno));
if ((oflags & O_CREAT) && errno == EISDIR) {
if (remove_empty_directories(lock->log_file)) {
return error("There are still logs under '%s'",
lock->log_file);
}
logfd = open(lock->log_file, oflags, 0666);
}
if (logfd < 0)
return error("Unable to append to %s: %s",
lock->log_file, strerror(errno));
}
committer = git_committer_info(1);

View File

@@ -11,6 +11,8 @@ semantic is still the same.
'
. ./test-lib.sh
echo '[core] logallrefupdates = true' >>.git/config
test_expect_success \
'prepare a trivial repository' \
'echo Hello > A &&