@@ -16,6 +16,26 @@ current_branch = head.name
16
16
url = ARGV . shift
17
17
cmd = ARGV . shift || "rake"
18
18
19
+ if current_branch == "gx-pull-check" and url == "done"
20
+ puts "Cleaning up pull-check..."
21
+ current_branch = File . read ( ".git/pull-check-origin" ) . strip
22
+
23
+ repo . git . checkout ( { } , current_branch )
24
+ repo . git . branch ( { :D => true } , "gx-pull-check" )
25
+
26
+ File . unlink ".git/pull-check-origin"
27
+
28
+ exit 0
29
+ elsif current_branch == "gx-pull-check"
30
+ puts "Currently handling a pull check already, please finish it first."
31
+ exit 1
32
+ end
33
+
34
+ unless url
35
+ puts "Usage: gx-pull-check URL [command to test]"
36
+ exit 1
37
+ end
38
+
19
39
puts "Performing pull check on '#{ url } '"
20
40
21
41
url += ".patch"
@@ -30,6 +50,10 @@ if $?.exitstatus != 0
30
50
exit 1
31
51
end
32
52
53
+ File . open ".git/pull-check-origin" , "w" do |f |
54
+ f . puts current_branch
55
+ end
56
+
33
57
puts "Step 2: Apply the pull request..."
34
58
repo . git . branch ( { } , "gx-pull-check" )
35
59
repo . git . checkout ( { } , "gx-pull-check" )
@@ -58,4 +82,6 @@ puts "Everything ran fine, feel free to merge the pull request!"
58
82
repo . git . checkout ( { } , current_branch )
59
83
repo . git . branch ( { :D => true } , "gx-pull-check" )
60
84
85
+ File . unlink ".git/pull-check-origin"
86
+
61
87
File . unlink patch
0 commit comments