]>
Commit | Line | Data |
---|---|---|
58168992 AM |
1 | --- a/git_slug/gitrepo.py.org 2014-11-20 12:53:31.342320473 +0100 |
2 | +++ b/git_slug/gitrepo.py 2014-11-20 12:53:15.482453868 +0100 | |
3 | @@ -82,12 +82,21 @@ class GitRepo: | |
4 | 'refs/notes/*:refs/notes/*']) | |
5 | ||
6 | def check_remote(self, ref, remote=REMOTE_NAME): | |
7 | + localref = EMPTYSHA1 | |
8 | ref = ref.replace(REFFILE, os.path.join('remotes', remote)) | |
9 | try: | |
10 | with open(os.path.join(self.gdir, ref), 'r') as f: | |
11 | localref = f.readline().strip() | |
12 | except IOError: | |
13 | - localref = EMPTYSHA1 | |
14 | + try: | |
15 | + with open(os.path.join(self.gdir, 'packed-refs')) as f: | |
16 | + for line in f: | |
17 | + line_data = line.split() | |
18 | + if len(line_data) == 2 and line_data[1] == ref: | |
19 | + localref = line_data[0].strip() | |
20 | + break | |
21 | + except IOError: | |
22 | + pass | |
23 | return localref | |
24 | ||
25 | def showfile(self, filename, ref="/".join([REMOTE_NAME, "master"])): |