summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a6f63ae)
raw | patch | inline | side by side (parent: a6f63ae)
author | Miklos Vajna <vmiklos@frugalware.org> | |
Sat, 6 Sep 2008 16:29:49 +0000 (18:29 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 7 Sep 2008 02:49:51 +0000 (19:49 -0700) |
Once we committed the locked index, we should release the lockfile. In
most cases this is done automatically when the process ends, but this is
not true in this case.
[jc: with additional tests from Eric Raible]
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
most cases this is done automatically when the process ends, but this is
not true in this case.
[jc: with additional tests from Eric Raible]
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-merge.c | patch | blob | history | |
t/t6026-merge-attr.sh | patch | blob | history |
diff --git a/builtin-merge.c b/builtin-merge.c
index b857cf6246978846e0c19895fd6f66266cf6a6f4..bb09e6fb34f8552b959fa5dca5258ec69bc48c12 100644 (file)
--- a/builtin-merge.c
+++ b/builtin-merge.c
(write_cache(index_fd, active_cache, active_nr) ||
commit_locked_index(lock)))
die ("unable to write %s", get_index_file());
+ rollback_lock_file(lock);
return clean ? 0 : 1;
} else {
args = xmalloc((4 + commit_list_count(common) +
diff --git a/t/t6026-merge-attr.sh b/t/t6026-merge-attr.sh
index 56fc34176859b81137b4d88af90398b9a74a18f7..86f47ca595c2d71e132c8acdbf7d8edadc1e0ecf 100755 (executable)
--- a/t/t6026-merge-attr.sh
+++ b/t/t6026-merge-attr.sh
rm -f $o $a $b
'
+test_expect_success 'up-to-date merge without common ancestor' '
+ test_create_repo repo1 &&
+ test_create_repo repo2 &&
+ test_tick &&
+ (
+ cd repo1 &&
+ >a &&
+ git add a &&
+ git commit -m initial
+ ) &&
+ test_tick &&
+ (
+ cd repo2 &&
+ git commit --allow-empty -m initial
+ ) &&
+ test_tick &&
+ (
+ cd repo1 &&
+ git pull ../repo2 master
+ )
+'
+
test_done