From a5a1b190d8f3d14eaf191a397a471fea12e7f93a Mon Sep 17 00:00:00 2001
From: Kostya Serebryany <kcc@google.com>
Date: Tue, 12 May 2015 23:19:12 +0000
Subject: [PATCH] [lib/Fuzzer] A simple script to synchronise a fuzz test
 corpus with an external git repository.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237208 91177308-0d34-0410-b5e6-96231b3b80d8
---
 lib/Fuzzer/pull_and_push_fuzz_corpus.sh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100755 lib/Fuzzer/pull_and_push_fuzz_corpus.sh

diff --git a/lib/Fuzzer/pull_and_push_fuzz_corpus.sh b/lib/Fuzzer/pull_and_push_fuzz_corpus.sh
new file mode 100755
index 00000000000..6c67cf0e0c6
--- /dev/null
+++ b/lib/Fuzzer/pull_and_push_fuzz_corpus.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+# A simple script to synchronise a fuzz test corpus
+# with an external git repository.
+# Usage:
+#   pull_and_push_fuzz_corpus.sh DIR
+# It assumes that DIR is inside a git repo and push
+# can be done w/o typing a password.
+cd $1
+git add *
+git commit -m "fuzz test corpus"
+git pull --no-edit
+for((attempt=0; attempt<100; attempt++)); do
+  echo GIT PUSH $1 ATTEMPT $attempt
+  if $(git push); then break; fi
+  git pull --no-edit
+done
+
-- 
2.34.1