Skip to content

Commit

Permalink
Issue-130 Updating to replace '/' with '-' when generating the sync c…
Browse files Browse the repository at this point in the history
…ontrol filename.
  • Loading branch information
Jason Harrell committed Apr 4, 2014
1 parent edbb2de commit b53f6cc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/git-process/git_lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,9 @@ def rename_branch(branch_name, new_name)


def sync_control_filename(branch_name)
File.join(File.join(workdir, '.git'), "gitprocess-sync-#{remote.name}--#{branch_name}")
normalized_branch_name = branch_name.to_s.gsub(/[\/]/, "-")

File.join(File.join(workdir, '.git'), "gitprocess-sync-#{remote.name}--#{normalized_branch_name}")
end

end
Expand Down
17 changes: 17 additions & 0 deletions spec/sync_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,23 @@ def verify_start_state
end
end

it 'should work when the branch name contins a slash' do
Given do
origin 'user/fb', :new_branch => 'master'
create_commit :b
local 'user/fb', :new_branch => 'origin/user/fb'
create_commit :c
end

@local.checkout('user/fb')
create_process(@local).runner

Then do
branch_tip(local_repo, 'user/fb').should == branch_tip(origin_repo, 'user/fb')
branch_tip(local_repo, 'user/fb').should == @local.sha('origin/user/fb')
end
end


describe 'when forcing the push with a merge' do

Expand Down

0 comments on commit b53f6cc

Please sign in to comment.