Skip to content

Improved way of listing URLs in remote #528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 18 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/master'
Conflicts:
	git/util.py
  • Loading branch information
expobrain committed Oct 6, 2016
commit 26f9b9f40144b73d75e739ef5e6552007b6376f8
20 changes: 11 additions & 9 deletions git/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
from __future__ import unicode_literals

from fcntl import flock, LOCK_UN, LOCK_EX, LOCK_NB
import os
import re
import sys
import time
import stat
import shutil
import platform
import getpass
import logging
import os
Expand Down Expand Up @@ -593,7 +586,10 @@ def _obtain_lock_or_raise(self):

# Create file and lock
try:
fd = os.open(lock_file, os.O_CREAT, 0)
flags = os.O_CREAT
if is_win:
flags |= os.O_SHORT_LIVED
fd = os.open(lock_file, flags, 0)
except OSError as e:
raise IOError(str(e))

Expand All @@ -617,8 +613,14 @@ def _release_lock(self):

flock(fd, LOCK_UN)
os.close(fd)
os.remove(lock_file)

# if someone removed our file beforhand, lets just flag this issue
# instead of failing, to make it more usable.
lfp = self._lock_file_path()
try:
rmfile(lfp)
except OSError:
pass
self._owns_lock = False
self._file_descriptor = None

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.