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
c11e9692
Commit
c11e9692
authored
Jul 19, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3578 from jlaska/git_branch
(git module) Resolve incompatability between depth and version
parents
6b2be84a
95a22338
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
library/source_control/git
+4
-2
No files found.
library/source_control/git
View file @
c11e9692
...
@@ -99,7 +99,7 @@ def get_version(git_path, dest):
...
@@ -99,7 +99,7 @@ def get_version(git_path, dest):
sha
=
sha
[
0
]
.
split
()[
1
]
sha
=
sha
[
0
]
.
split
()[
1
]
return
sha
return
sha
def
clone
(
git_path
,
module
,
repo
,
dest
,
remote
,
depth
):
def
clone
(
git_path
,
module
,
repo
,
dest
,
remote
,
depth
,
version
):
''' makes a new git repo if it does not already exist '''
''' makes a new git repo if it does not already exist '''
dest_dirname
=
os
.
path
.
dirname
(
dest
)
dest_dirname
=
os
.
path
.
dirname
(
dest
)
try
:
try
:
...
@@ -108,6 +108,8 @@ def clone(git_path, module, repo, dest, remote, depth):
...
@@ -108,6 +108,8 @@ def clone(git_path, module, repo, dest, remote, depth):
pass
pass
os
.
chdir
(
dest_dirname
)
os
.
chdir
(
dest_dirname
)
cmd
=
[
git_path
,
'clone'
,
'-o'
,
remote
,
'--recursive'
]
cmd
=
[
git_path
,
'clone'
,
'-o'
,
remote
,
'--recursive'
]
if
version
:
cmd
.
extend
([
'--branch'
,
str
(
version
)
])
if
depth
:
if
depth
:
cmd
.
extend
([
'--depth'
,
str
(
depth
)
])
cmd
.
extend
([
'--depth'
,
str
(
depth
)
])
cmd
.
extend
([
repo
,
dest
])
cmd
.
extend
([
repo
,
dest
])
...
@@ -317,7 +319,7 @@ def main():
...
@@ -317,7 +319,7 @@ def main():
if
not
os
.
path
.
exists
(
gitconfig
):
if
not
os
.
path
.
exists
(
gitconfig
):
if
module
.
check_mode
:
if
module
.
check_mode
:
module
.
exit_json
(
changed
=
True
)
module
.
exit_json
(
changed
=
True
)
(
rc
,
out
,
err
)
=
clone
(
git_path
,
module
,
repo
,
dest
,
remote
,
depth
)
(
rc
,
out
,
err
)
=
clone
(
git_path
,
module
,
repo
,
dest
,
remote
,
depth
,
version
)
elif
not
update
:
elif
not
update
:
# Just return having found a repo already in the dest path
# Just return having found a repo already in the dest path
# this does no checking that the repo is the actual repo
# this does no checking that the repo is the actual repo
...
...
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