Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
ae7e1928
Commit
ae7e1928
authored
Aug 08, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #790 from sfromm/fixgit
Fix error handling when switching versions
parents
7dd7755f
6265be3a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
7 deletions
+2
-7
library/git
+2
-7
No files found.
library/git
View file @
ae7e1928
...
...
@@ -58,11 +58,6 @@ def reset(dest):
rc
=
cmd
.
returncode
return
(
rc
,
out
,
err
)
def
switchLocalBranch
(
branch
):
cmd
=
"git checkout
%
s"
%
branch
cmd
=
subprocess
.
Popen
(
cmd
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
return
cmd
.
communicate
()
def
get_branches
(
module
,
dest
):
os
.
chdir
(
dest
)
branches
=
[]
...
...
@@ -156,7 +151,7 @@ def main():
gitconfig
=
os
.
path
.
join
(
dest
,
'.git'
,
'config'
)
out
,
err
,
status
=
(
None
,
None
,
None
)
rc
,
out
,
err
,
status
=
(
0
,
None
,
None
,
None
)
# if there is no git configuration, do a clone operation
# else pull and switch the version
...
...
@@ -180,7 +175,7 @@ def main():
# switch to version specified regardless of whether
# we cloned or pulled
(
rc
,
out
,
err
)
=
switch_version
(
module
,
dest
,
remote
,
version
)
if
err
.
find
(
'error'
)
!=
-
1
:
if
rc
!=
0
:
module
.
fail_json
(
msg
=
err
)
# determine if we changed anything
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment