Skip to content

Commit 6391658

Browse files
committed
OTWO-4721 Raise an exception if repository is empty
1 parent ac171bb commit 6391658

31 files changed

+869
-1
lines changed

lib/ohloh_scm/adapters/git/pull.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ class GitAdapter < AbstractAdapter
33

44
def pull(from, &block)
55
logger.info { "Pulling #{from.url}" }
6+
67
case from
78
when GitAdapter
89
clone_or_fetch(from, &block)
@@ -104,6 +105,8 @@ def convert(source_scm)
104105
commit_all(r)
105106
end
106107
yield(commits.size, commits.size) if block_given?
108+
elsif !read_token && commits.empty?
109+
raise RuntimeError, "Empty repository"
107110
else
108111
logger.info { "Already up-to-date." }
109112
end

lib/ohloh_scm/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module OhlohScm
22
module Version
3-
STRING = '2.2.12'
3+
STRING = '2.2.13'
44
end
55
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
This is a Subversion repository; use the 'svnadmin' and 'svnlook'
2+
tools to examine it. Do not add, delete, or modify files here
3+
unless you know how to avoid corrupting the repository.
4+
5+
Visit http://subversion.apache.org/ for more information.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
### This file is an example authorization file for svnserve.
2+
### Its format is identical to that of mod_authz_svn authorization
3+
### files.
4+
### As shown below each section defines authorizations for the path and
5+
### (optional) repository specified by the section name.
6+
### The authorizations follow. An authorization line can refer to:
7+
### - a single user,
8+
### - a group of users defined in a special [groups] section,
9+
### - an alias defined in a special [aliases] section,
10+
### - all authenticated users, using the '$authenticated' token,
11+
### - only anonymous users, using the '$anonymous' token,
12+
### - anyone, using the '*' wildcard.
13+
###
14+
### A match can be inverted by prefixing the rule with '~'. Rules can
15+
### grant read ('r') access, read-write ('rw') access, or no access
16+
### ('').
17+
18+
[aliases]
19+
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
20+
21+
[groups]
22+
# harry_and_sally = harry,sally
23+
# harry_sally_and_joe = harry,sally,&joe
24+
25+
# [/foo/bar]
26+
# harry = rw
27+
# &joe = r
28+
# * =
29+
30+
# [repository:/baz/fuz]
31+
# @harry_and_sally = rw
32+
# * = r
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
### This file is an example hook script environment configuration file.
2+
### Hook scripts run in an empty environment by default.
3+
### As shown below each section defines environment variables for a
4+
### particular hook script. The [default] section defines environment
5+
### variables for all hook scripts, unless overridden by a hook-specific
6+
### section.
7+
8+
### This example configures a UTF-8 locale for all hook scripts, so that
9+
### special characters, such as umlauts, may be printed to stderr.
10+
### If UTF-8 is used with a mod_dav_svn server, the SVNUseUTF8 option must
11+
### also be set to 'yes' in httpd.conf.
12+
### With svnserve, the LANG environment variable of the svnserve process
13+
### must be set to the same value as given here.
14+
[default]
15+
LANG = en_US.UTF-8
16+
17+
### This sets the PATH environment variable for the pre-commit hook.
18+
[pre-commit]
19+
PATH = /usr/local/bin:/usr/bin:/usr/sbin
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
### This file is an example password file for svnserve.
2+
### Its format is similar to that of svnserve.conf. As shown in the
3+
### example below it contains one section labelled [users].
4+
### The name and password for each user follow, one account per line.
5+
6+
[users]
7+
# harry = harryssecret
8+
# sally = sallyssecret
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
### This file controls the configuration of the svnserve daemon, if you
2+
### use it to allow access to this repository. (If you only allow
3+
### access through http: and/or file: URLs, then this file is
4+
### irrelevant.)
5+
6+
### Visit http://subversion.apache.org/ for more information.
7+
8+
[general]
9+
### The anon-access and auth-access options control access to the
10+
### repository for unauthenticated (a.k.a. anonymous) users and
11+
### authenticated users, respectively.
12+
### Valid values are "write", "read", and "none".
13+
### Setting the value to "none" prohibits both reading and writing;
14+
### "read" allows read-only access, and "write" allows complete
15+
### read/write access to the repository.
16+
### The sample settings below are the defaults and specify that anonymous
17+
### users have read-only access to the repository, while authenticated
18+
### users have read and write access to the repository.
19+
# anon-access = read
20+
# auth-access = write
21+
### The password-db option controls the location of the password
22+
### database file. Unless you specify a path starting with a /,
23+
### the file's location is relative to the directory containing
24+
### this configuration file.
25+
### If SASL is enabled (see below), this file will NOT be used.
26+
### Uncomment the line below to use the default password file.
27+
# password-db = passwd
28+
### The authz-db option controls the location of the authorization
29+
### rules for path-based access control. Unless you specify a path
30+
### starting with a /, the file's location is relative to the
31+
### directory containing this file. The specified path may be a
32+
### repository relative URL (^/) or an absolute file:// URL to a text
33+
### file in a Subversion repository. If you don't specify an authz-db,
34+
### no path-based access control is done.
35+
### Uncomment the line below to use the default authorization file.
36+
# authz-db = authz
37+
### The groups-db option controls the location of the groups file.
38+
### Unless you specify a path starting with a /, the file's location is
39+
### relative to the directory containing this file. The specified path
40+
### may be a repository relative URL (^/) or an absolute file:// URL to a
41+
### text file in a Subversion repository.
42+
# groups-db = groups
43+
### This option specifies the authentication realm of the repository.
44+
### If two repositories have the same authentication realm, they should
45+
### have the same password database, and vice versa. The default realm
46+
### is repository's uuid.
47+
# realm = My First Repository
48+
### The force-username-case option causes svnserve to case-normalize
49+
### usernames before comparing them against the authorization rules in the
50+
### authz-db file configured above. Valid values are "upper" (to upper-
51+
### case the usernames), "lower" (to lowercase the usernames), and
52+
### "none" (to compare usernames as-is without case conversion, which
53+
### is the default behavior).
54+
# force-username-case = none
55+
### The hooks-env options specifies a path to the hook script environment
56+
### configuration file. This option overrides the per-repository default
57+
### and can be used to configure the hook script environment for multiple
58+
### repositories in a single file, if an absolute path is specified.
59+
### Unless you specify an absolute path, the file's location is relative
60+
### to the directory containing this file.
61+
# hooks-env = hooks-env
62+
63+
[sasl]
64+
### This option specifies whether you want to use the Cyrus SASL
65+
### library for authentication. Default is false.
66+
### This section will be ignored if svnserve is not built with Cyrus
67+
### SASL support; to check, run 'svnserve --version' and look for a line
68+
### reading 'Cyrus SASL authentication is available.'
69+
# use-sasl = true
70+
### These options specify the desired strength of the security layer
71+
### that you want SASL to provide. 0 means no encryption, 1 means
72+
### integrity-checking only, values larger than 1 are correlated
73+
### to the effective key length for encryption (e.g. 128 means 128-bit
74+
### encryption). The values below are the defaults.
75+
# min-encryption = 0
76+
# max-encryption = 256
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
6
2+
layout sharded 1000
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fsfs

0 commit comments

Comments
 (0)