Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
1804c7dd
"README.md" did not exist on "f7bd5e64a013bf8caebbe5d3495199fcab0b6945"
Commit
1804c7dd
authored
4 years ago
by
felmer
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-10611: adapting in backward compatible way to work also with git-annex version 8
parent
51efb176
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
obis/src/python/obis/dm/git.py
+11
-2
11 additions, 2 deletions
obis/src/python/obis/dm/git.py
with
11 additions
and
2 deletions
obis/src/python/obis/dm/git.py
+
11
−
2
View file @
1804c7dd
...
...
@@ -39,6 +39,12 @@ class GitWrapper(object):
if
self
.
_git
([
'
annex
'
,
'
help
'
]).
failure
():
# git help should have a returncode of 0
return
False
result
=
self
.
_git
([
'
annex
'
,
'
version
'
])
if
result
.
success
():
first_line
=
result
.
output
.
split
(
"
\n
"
)[
0
].
split
(
"
:
"
)
if
len
(
first_line
)
>
1
:
self
.
annex_version
=
first_line
[
1
].
strip
()
self
.
annex_major_version
=
int
(
self
.
version
.
split
(
"
.
"
)[
0
])
return
True
def
git_init
(
self
):
...
...
@@ -72,7 +78,7 @@ class GitWrapper(object):
return
result
# direct mode so annex uses hard links instead of soft links
cmd
=
[
"
annex
"
,
"
direct
"
]
cmd
=
[
"
annex
"
,
"
unlock
"
if
self
.
annex_major_version
>=
8
else
"
direct
"
]
result
=
self
.
_git
(
cmd
)
if
result
.
failure
():
return
result
...
...
@@ -112,7 +118,10 @@ class GitWrapper(object):
def
git_add
(
self
,
path
):
# git annex add to avoid out of memory error when adding files bigger than RAM
return
self
.
_git
([
"
annex
"
,
"
add
"
,
path
,
"
--include-dotfiles
"
])
cmd
=
[
"
annex
"
,
"
add
"
,
path
]
if
self
.
annex_major_version
<
8
:
cmd
.
append
(
"
--include-dotfiles
"
)
return
self
.
_git
(
cmd
)
def
git_commit
(
self
,
msg
):
return
self
.
_git
([
'
commit
'
,
'
--allow-empty
'
,
'
-m
'
,
msg
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment