Skip to content

Commit

Permalink
fix(fetch.rb): explicitly run branch master
Browse files Browse the repository at this point in the history
Signed-off-by: Norwid Behrnd <[email protected]>
  • Loading branch information
nbehrnd committed Apr 21, 2024
1 parent 13dfbf7 commit cd36f76
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions levels/fetch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

# local repo
repo.init
system "git branch -m master"

# adds a file to origin/master
FileUtils.touch "master_file"
Expand Down Expand Up @@ -51,16 +52,16 @@
# after a git fetch command, each branch will be stored in in the .git/FETCH_HEAD file. Each branch is on its own line
# This command will count the number of lines, which will give the number of branches
if File.file?('.git/FETCH_HEAD') # checks for file existence
num_remote = File.read(".git/FETCH_HEAD").split("\n").count
num_remote = File.read(".git/FETCH_HEAD").split("\n").count
else
num_remote = 0
num_remote = 0
end

# there should be 1 local branch and 2 remote branches for a success condition
if local_branches == 1 and num_remote == 2
result = true
result = true
else
result = false
result = false
end
end

Expand Down

0 comments on commit cd36f76

Please sign in to comment.