diff options
| author | Matt Corallo <[email protected]> | 2017-03-01 10:35:27 -0500 |
|---|---|---|
| committer | Matt Corallo <[email protected]> | 2017-03-01 11:22:06 -0500 |
| commit | be908a69bf74a74a263bde14c310b397abe6776f (patch) | |
| tree | 1e42fb9c8436f6c7ee5c4ccd31d4785f798ee669 | |
| parent | Merge #9821: util: Specific GetOSRandom for Linux/FreeBSD/OpenBSD (diff) | |
| download | discoin-be908a69bf74a74a263bde14c310b397abe6776f.tar.xz discoin-be908a69bf74a74a263bde14c310b397abe6776f.zip | |
Fail merge if there are any symlinks
| -rwxr-xr-x | contrib/devtools/github-merge.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/contrib/devtools/github-merge.py b/contrib/devtools/github-merge.py index bb6ffb025..eedb485a3 100755 --- a/contrib/devtools/github-merge.py +++ b/contrib/devtools/github-merge.py @@ -70,6 +70,14 @@ def ask_prompt(text): print("",file=stderr) return reply +def get_symlink_files(): + files = sorted(subprocess.check_output([GIT, 'ls-tree', '--full-tree', '-r', 'HEAD']).splitlines()) + ret = [] + for f in files: + if (int(f.decode('utf-8').split(" ")[0], 8) & 0o170000) == 0o120000: + ret.append(f.decode('utf-8').split("\t")[1]) + return ret + def tree_sha512sum(): files = sorted(subprocess.check_output([GIT, 'ls-tree', '--full-tree', '-r', '--name-only', 'HEAD']).splitlines()) overall = hashlib.sha512() @@ -200,6 +208,12 @@ def main(): print("ERROR: Creating merge failed (already merged?).",file=stderr) exit(4) + symlink_files = get_symlink_files() + for f in symlink_files; + print("ERROR: File %s was a symlink" % f) + if len(symlink_files) > 0: + exit(4) + # Put tree SHA512 into the message try: first_sha512 = tree_sha512sum() |