diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-05-22 12:41:55 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-05-22 12:41:55 -0700 |
commit | fb257bfa174b00e236ac5d6f4282a487f10a9e98 (patch) | |
tree | 616da2c04e2140fe22bd4cfaf7f3b9b764d769c3 /t | |
parent | 29b2041c2a91d2f80afa9d4e0f6eeb77a3ff5bc6 (diff) | |
parent | f4ab4f3ab117cf375ae7bb8908c7b5ad687342b1 (diff) | |
download | git-fb257bfa174b00e236ac5d6f4282a487f10a9e98.tar.gz |
Merge branch 'mh/lockfile-retry'
Instead of dying immediately upon failing to obtain a lock, retry
after a short while with backoff.
* mh/lockfile-retry:
lock_packed_refs(): allow retries when acquiring the packed-refs lock
lockfile: allow file locking to be retried with a timeout
Diffstat (limited to 't')
-rwxr-xr-x | t/t3210-pack-refs.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh index aa9eb3a3e5..8aae98d482 100755 --- a/t/t3210-pack-refs.sh +++ b/t/t3210-pack-refs.sh @@ -187,4 +187,21 @@ test_expect_success 'notice d/f conflict with existing ref' ' test_must_fail git branch foo/bar/baz/lots/of/extra/components ' +test_expect_success 'timeout if packed-refs.lock exists' ' + LOCK=.git/packed-refs.lock && + >"$LOCK" && + test_when_finished "rm -f $LOCK" && + test_must_fail git pack-refs --all --prune +' + +test_expect_success 'retry acquiring packed-refs.lock' ' + LOCK=.git/packed-refs.lock && + >"$LOCK" && + test_when_finished "wait; rm -f $LOCK" && + { + ( sleep 1 ; rm -f $LOCK ) & + } && + git -c core.packedrefstimeout=3000 pack-refs --all --prune +' + test_done |