Permalink
Browse files

implementing git update

  • Loading branch information...
1 parent e957b0c commit b26ed2695204cd90ddf369d63338230a8f0eb268 David Rouchy committed Mar 27, 2011
Showing with 13 additions and 1 deletion.
  1. +2 −1 extras/big_tuna/vcs/git.rb
  2. +11 −0 test/unit/git_vcs_test.rb
@@ -56,7 +56,8 @@ def clone(where_to)
end
def update(where_to)
-
+ command = 'git pull'
+ BigTuna::Runner.execute(File.join(Dir.pwd, where_to), command)
end
end
end
View
@@ -54,6 +54,17 @@ def teardown
assert vcs.support_incremental_build?
end
+ test "git update should get commit in the clone" do
+ `cd test/files/repo; echo "new file" > new_file; git add new_file; git commit -m "new file"`
+ vcs = init_repo("test/files/repo", "master")
+ vcs.clone("test/files/repo_clone")
+
+ `cd test/files/repo; echo "new file" > new_file_2; git add new_file_2; git commit -m "new second file"`
+ vcs.update("test/files/repo_clone")
+
+ assert File.file?("test/files/repo_clone/new_file_2"), "The file has not been pulled"
+ end
+
private
def init_repo(dir = "test/files/repo", branch = "master")
BigTuna::VCS::Git.new(dir, branch)

0 comments on commit b26ed26

Please sign in to comment.