summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-10-23 17:41:23 +0100
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-12-03 10:23:35 +0000
commit7e975343c7f00e98962d2edd07ac87630c4936c4 (patch)
tree240d0b16846a1fed3892999b00d8f8935c0bb16c
parent2dc11594d5b95d876c9997ca40dfb08bf06c830b (diff)
downloadmorph-7e975343c7f00e98962d2edd07ac87630c4936c4.tar.gz
Remove unused code from morphlib.git
There is still code here that duplicates stuff the GitDirectory class should be doing, I think.
-rw-r--r--morphlib/git.py24
1 files changed, 0 insertions, 24 deletions
diff --git a/morphlib/git.py b/morphlib/git.py
index 944ddc30..456aa4c0 100644
--- a/morphlib/git.py
+++ b/morphlib/git.py
@@ -14,7 +14,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-import binascii
import cliapp
import ConfigParser
import logging
@@ -23,10 +22,6 @@ import re
import string
import StringIO
import sys
-import time
-
-
-import cliapp
import morphlib
@@ -226,11 +221,6 @@ def check_config_set(runcmd, keys, cwd='.'):
return found
-def set_remote(runcmd, gitdir, name, url):
- '''Set remote with name 'name' use a given url at gitdir'''
- return gitcmd(runcmd, 'remote', 'set-url', name, url, cwd=gitdir)
-
-
def copy_repository(runcmd, repo, destdir, is_mirror=True):
'''Copies a cached repository into a directory using cp.
@@ -275,16 +265,6 @@ def copy_repository(runcmd, repo, destdir, is_mirror=True):
gitcmd(runcmd, 'remote', 'update', 'origin', '--prune', cwd=destdir)
-def index_has_changes(runcmd, gitdir):
- '''Returns True if there are no staged changes to commit'''
- try:
- gitcmd(runcmd, 'diff-index', '--cached', '--quiet',
- '--ignore-submodules', 'HEAD', cwd=gitdir)
- except cliapp.AppException:
- return True
- return False
-
-
def reset_workdir(runcmd, gitdir):
'''Removes any differences between the current commit '''
'''and the status of the working directory'''
@@ -312,10 +292,6 @@ def is_valid_sha1(ref):
return len(ref) == 40 and all(x in string.hexdigits for x in ref)
-def rev_parse(runcmd, gitdir, ref):
- '''Find the sha1 for the given ref'''
- return gitcmd(runcmd, 'rev-parse', '--verify', ref, cwd=gitdir)[0:40]
-
def gitcmd(runcmd, *args, **kwargs):
'''Run git commands safely'''